Support for the config modifiers in the PEG notation - #135
Draft
andr-dots wants to merge 90 commits into
Draft
Conversation
…deep copy operation
The parser state class was decomposed into the main class and the state level class. The code responsible for the state data that should depend on a state level was moved to the state parsing class.
…pressions with state layers The changes are incompatible with the previous PEG actions implementation; state actions were removed.
…ules of the PEG notation
andr-dots
force-pushed
the
peg-modify-config
branch
from
August 6, 2025 16:00
b281b2c to
2b317b7
Compare
…es the code less readable
…es that were failed
…ld be reused in other cases
…use of the config modifiers
… into the two different files
…G config modifiers test suite
…yntax in the PEG notation
andr-dots
force-pushed
the
peg-modify-config
branch
from
August 6, 2025 20:02
2b317b7 to
0cebcde
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Arpeggio allows to set some config parameters in the initialization of the parser, but those modifiers has to be changed sometimes during the runtime. For example, in some cases you need to consume whitespace characters as regular text.
In this pull request, the config modifiers were introduced in the PEG notation, so that they can affect a single rule or a grouped expression. The config modifiers use square brackets before a parsing expression to set the config parameters. Some examples:
Also, config modifiers allow to debug erroneous rules more easily like this:
[debug=True]erroneous_rules. This way, there wouldn't be a long sheet of debug output from the other rules.This pull request depends on #131.
Code review checklist
CHANGELOG.md, no needto update for typo fixes and such).