Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support backtracking and Checkpoints across nodes #68

Merged
merged 5 commits into from
Nov 1, 2024

Conversation

domenicquirl
Copy link
Owner

Makes Checkpoints work across node boundaries and adds a new method GreenTreeBuilder::revert_to to support backtracking parsers.

This PR supersedes #67. Context from that PR:

Rowan, and hence CSTree, is designed around hand-written parsers. In particular, the APIs for building trees require that each token is recorded only once.

Some parsers, and especially parser combinators, use backtracking instead, where the same token may be seen multiple times. To support this, add a new revert function which discards all tokens seen since the last checkpoint.

jyn514 and others added 5 commits October 18, 2024 12:17
Rowan, and hence CSTree, is designed around hand-written parsers.
In particular, the APIs for *building* trees require that each token is recorded only once.

Some parsers, and especially parser combinators, use backtracking instead, where the same token may be seen multiple times.
To support this, add a new `revert` function which discards all tokens seen since the last checkpoint.
@domenicquirl domenicquirl self-assigned this Nov 1, 2024
@domenicquirl domenicquirl merged commit d602fe2 into master Nov 1, 2024
19 of 23 checks passed
@domenicquirl domenicquirl deleted the checkpoint-across-nodes branch November 1, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants