snapdragon-lexer
Advanced tools
Changelog
[3.0.0] - 2018-01-11
lexer.last()
Changelog
[2.0.0] - 2018-01-08
The following changes were made in an effort to make the API closer to other popular parsing libraries, such as babel and acorn.
token.val
to token.value
lexer.loc.column
was changed from a 1-index number to a 0-index number.current
is now a property set by the .handle()
method. The value of lexer.current
is whatever is returned by a handler..prev()
now returns the previously lexed token.push()
lexer.options.mode
is set to character
, lexer.advance()
will consume and return a single character each time it's called, instead of iterating over the handlers.token.match
array is now decorated with a .consumed
property, which is the value of lexer.consumed
before the match was created.lexer.stack
for tracking opening/closing structureslexer.stash
for storing an array of strings (in addition to lexer.tokens
, which stores objects).append
.skipWhile
.skipSpaces
Changelog
[1.0.0] - 2017-11-30
.skipType
method