Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TextScannerLexer lexer.Definition = &textScannerLexerDefinition{} // DefaultDefinition defines properties for the default lexer. DefaultDefinition = TextScannerLexer )
TextScannerLexer is a lexer that uses the text/scanner module.
Functions ¶
func Lex ¶
Lex an io.Reader with text/scanner.Scanner.
This provides very fast lexing of source code compatible with Go tokens.
Note that this differs from text/scanner.Scanner in that string tokens will be unquoted.
func LexWithScanner ¶
LexWithScanner creates a Lexer from a user-provided scanner.Scanner.
Useful if you need to customise the Scanner.
func NewCustomTextScannerLexer ¶
func NewCustomTextScannerLexer() lexer.Definition
NewCustomTextScannerLexer constructs a Definition that uses an underlying scanner.Scanner
It's custom because: - string token can have different sets of quotes: single, double, backtick - special token type - JSON
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.