Skip to content

Handle correcly state with pegtl grammar #139

Answered by ColinH
alangab asked this question in Q&A
Discussion options

You must be logged in to vote

You're welcome! For the record, another possibility, if not particularly elegant, is to use the (infinite) lookahead feature of PEGs.

With something like seq< at< foo >, foo >, the first foo will attempt to match with actions disabled, and only if that succeeded will foo be matched "for real", i.e. with actions enabled.

Replies: 7 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by d-frey
Comment options

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

This discussion was converted from issue #139 on December 09, 2020 09:50.