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

Match tree traversal API #18

Closed
conartist6 opened this issue Sep 5, 2022 · 1 comment
Closed

Match tree traversal API #18

conartist6 opened this issue Sep 5, 2022 · 1 comment

Comments

@conartist6
Copy link
Member

I currently provide a few discrete tree-integration methods exported from index, e.g. updateTokens. These methods traverse a match tree. I would like to refactor that code into traversal and visitors, so that a single traversal could perform many operations, e.g. rebuilding tokens and updating ranges in a single pass.

@conartist6
Copy link
Member Author

I've settled on exposing matchNodesByRef, which saves you from needing to do anything very complicated to achieve a traversal. You don't need to know about the structure of the AST to traverse it, and you don't need to set up and use a resolver either.

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

No branches or pull requests

1 participant