Skip to content

Disjunction rules exclude members (strings) which contain previous members (substrings) #822

Answered by NoahTheDuke
lthoerner asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tomtau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #821 on March 06, 2023 01:53.