8000 Tags · domenicquirl/cstree · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Tags: domenicquirl/cstree

Tags

v0.12.2

Toggle v0.12.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Support backtracking and `Checkpoint`s across nodes (#68)

* Add [`GreenTreeBuilder::revert`] to support backtracking parsers

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.

* allow checkpointing across nodes (within reason)

* clean up asserts and expand documentation

* add Changelog entry

* prepare v0.12.2 release

---------

Co-authored-by: jyn <github@jyn.dev>
Co-authored-by: Domenic Quirl <DomenicQuirl@protonmail.com>
0