Disjunction rules exclude members (strings) which contain previous members (substrings) #822
-
Describe the bug In a disjunction, if there exist both an Consider the rule Exceptions:
To Reproduce
Where Expected behavior Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is a feature of PEG parsers. The OR is called an ordered choice, meaning that each potential options is considered in definition order and the first match is used without checking the rest of the choices. This is important due to PEG's backtracking (and memoization), which allows for arbitrarily nested rules without ambiguity. |
Beta Was this translation helpful? Give feedback.
This is a feature of PEG parsers. The OR is called an ordered choice, meaning that each potential options is considered in definition order and the first match is used without checking the rest of the choices. This is important due to PEG's backtracking (and memoization), which allows for arbitrarily nested rules without ambiguity.