Documentation ¶
Index ¶
- func FirstNonHintToken(filepath, s string) (token.Token, error)
- func LexerSeq(lexer *memefish.Lexer) iter.Seq2[token.Token, error]
- func NewLexerSeq(filename, s string) iter.Seq2[token.Token, error]
- func SimpleSkipHints(filepath, s string) (string, error)
- func SimpleSkipHintsSeq(seq iter.Seq2[token.Token, error]) iter.Seq2[token.Token, error]
- func SimpleStripComments(filepath, s string) (string, error)
- func StripComments(filepath, s string) (string, error)
- type ErrLexerStatus
- type RawStatement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstNonHintToken ¶
FirstNonHintToken returns the first non-hint token. filepath can be empty, it is only used in error message. Note: Currently, this function doesn't take care about nested curly brace in a hint.
func LexerSeq ¶
LexerSeq converts memefish.Lexer to iter.Seq2 with error. If it reaches to EOF, it stops without error.
func SimpleSkipHints ¶
SimpleSkipHints strips hints in an input string without parsing. It don't preserve any hints and comments and whitespaces. All tokens are separated with a single whitespace. filepath can be empty, it is only used in error message.
func SimpleSkipHintsSeq ¶
func SimpleStripComments ¶
SimpleStripComments strips comments in an input string without parsing. It don't preserve whitespaces. All tokens are separated with a single whitespace. filepath can be empty, it is only used in error message.
func StripComments ¶
StripComments strips comments in an input string without parsing but preserving whitespaces. This function won't panic but return error if lexer become error state. filepath can be empty, it is only used in error message.
Types ¶
type ErrLexerStatus ¶
type ErrLexerStatus struct {
WaitingString string
}
func (*ErrLexerStatus) Error ¶
func (e *ErrLexerStatus) Error() string
type RawStatement ¶
func SeparateInputPreserveCommentsWithStatus ¶
func SeparateInputPreserveCommentsWithStatus(filepath, s string) ([]RawStatement, error)
func (*RawStatement) StripComments ¶
func (stmt *RawStatement) StripComments() (RawStatement, error)