no-context / moo

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

Numeric pop #65

Closed tjvr closed 7 years ago

tjvr commented 7 years ago

...I was convinced that you could pop multiple states, but that doesn't appear to currently be the case.

{match: 'foo', pop: 2}

Is this useful, or should I amend the documentation to make clear you can't?

nathan commented 7 years ago

I was initially going to allow this when I was implementing states, but I couldn't think of any reasonable use cases.

tjvr commented 7 years ago

Fixed in 2efc96b (numbers now throw an error, since they're not supported).

nathan commented 7 years ago

Perhaps only disallow numbers that aren't 1? Some people like to use {flag: 1} in object literals because it's short and truthy.

tjvr commented 7 years ago

Okay! 7641fd1