no-context / moo

Optimised tokenizer/lexer generator! 🐄 Uses /y for performance. Moo.
BSD 3-Clause "New" or "Revised" License
814 stars 65 forks source link

Keyword transformation #157

Closed jpsalm closed 3 years ago

jpsalm commented 3 years ago

I'm not if this is possible in moo but let's say I'm interested in lexing the words "eat" and "eats". I'd like them to both map to a token of type VERB with a value of EAT. Is there a way to do this with the convenient array-based syntax for keywords?