Closed palantus closed 3 years ago
Oops, was not aware of the flex and easy_keyword_rules options. Just ignore this issue and refer to the answer here for more information, if you encounter the same problem :)
https://stackoverflow.com/questions/65581744/jison-how-do-i-avoid-dog-being-parsed-as-do
Hi
I have a problem while trying to create a parser for a programming language. Whenever I use eg. variables, enumeration values etc. with names like "dog", it will be matched to "do" (as in do-while). I've created this minimal example:
When I use that to parse
PetTypes::dog
, I get the following error:As far as I understand, it should match ID according to the flex pattern matching rules, because that is the longest possible match.
I just tried using the original jison npm package and I don't get any error with that. It only (as expected) complains if I parse
PetTypes::do
.Is this a bug or am I missing something?