Parser forgets to check every alteration sometimes. #459
Replies: 2 comments 1 reply
-
Ah, i think i found the issue. The parser gets too greedy. For example, |
Beta Was this translation helpful? Give feedback.
-
Yes, Ohm works in a way that's fundamentally different than some other tools you might have used in the past. It's based a formalism called parsing expression grammars. The main differences are exactly as you describe:
The latter is mentioned on the Patterns & Pitfalls page, but I see now that the tutorial doesn't mention these things! It's probably worth adding. |
Beta Was this translation helpful? Give feedback.
-
I have this code for a Rule:
And the parser is not checking
Value_Function
norValue_String
.Value_Expression
leads it to the end of the string and the parser forgets that it could useValue_Function
orValue_String
instead ofValue_Function nor Value_Expression
. I have a part ofValue_Expression
that includesend
. Am I supposed to avoid usingend
or something?Here is the full Grammar file (in case it is helpful; yes, I know it is long):
Beta Was this translation helpful? Give feedback.
All reactions