A very basic lexer that simply just takes string and RegExp
patterns and
spits out the associated tokens with no advanced bells and whistles.
new
SimpleLexer(definition: D)
D extends SimpleLexerDefinitions
match(input: string,offset: number,): SimpleLexerToken<_ExtractType<D["tokens"]>> | null
Matches a token at the given offset
in input
.
Returns a copy of the internal match pattern.
tokenize(input: string,offset?: number,): Generator<SimpleLexerToken<_ExtractType<D["tokens"]>>, void>
Tokenizes the input
starting at the given offset
.