Closed rvion closed 6 months ago
This is how token precedence works. @precedence { Word, Number }
means that any token that can be tokenized as both a word and a number should be number, regardless of what the parser accepts at that point.
You might be able to get what you want by defining two different 'word' tokensβone that is only used in situations where numbers aren't valid, and once, with lower precedence than number tokens, that is used in places where numbers may occur.
hello @marijnh , thanks for the awesome lib
I'm having an issue with overlapping tokens. I think this is a bug. various @precedence config yield invalid parses, despite the grammar beeing non ambiguous. π΄ causes the wrong token to be parsed in areas where they shouldn't be valid.
Full executable repro with test case here: https://github.com/rvion/lezer-repro-2024-02-05 (scripts in package.json to run test file and regen grammar)
but everything needed to see if it is a bug should be here π