3 ms·
This seems more flexible to me somehow. Using the approach in TFA, can the laser handle tokens that are prefixes of other tokens? Or even tokens that share pre
by repsilat 7y ago
This seems more flexible to me somehow.
Using the approach in TFA, can the laser handle tokens that are prefixes of other tokens? Or even tokens that share prefixes?
Lexing "truefalse" as two adjacent tokens "true" and "false" seems slightly crazier than just lexing it as one (meaningless) token.
- ufo 7y agoUsually, if there is a token that is a prefix of another the longer token wins. For example, in Javascript --x is parsed as the decrement operator instead of as two unary "-" operators.