Documentation ¶
Overview ¶
Package lexer implements the lexical scanners of javascript source code into a sequence of tokens.
Index ¶
Constants ¶
This section is empty.
Variables ¶
EOF is the End of File token.
Functions ¶
func Lex ¶
Lex will lex the given crappy JS code (utf16 yay) and provide a stream of tokens as a result (the returned channel).
The caller should iterate on the given channel until it is closed indicating a EOF (or an error). Errors should be handled by checking the type of the token.
A goroutine will be started to lex the given code, if you do not iterate the returned channel the goroutine will leak, you MUST drain the provided channel.
Types ¶
Click to show internal directories.
Click to hide internal directories.