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

Allow retrieving a tree's list of included ranges, fix some included range bugs #1952

Merged
merged 7 commits into from Nov 15, 2022

Conversation

maxbrunsfeld
Copy link
Contributor

@maxbrunsfeld maxbrunsfeld commented Nov 9, 2022

Closes #1939

This PR adds a ts_tree_included_ranges function to the C API, which allows you to retrieve the included ranges that were used to parse a tree.

I've also fixed some other bugs related to the included_ranges APIs:

  • A bug where some included ranges were not updated properly when editing a tree, which could lead to incorrect results from ts_tree_get_changed_ranges.
  • A bug where the parser would read a spurious null character at the end of an included_range in certain circumstances, leading to false parse errors.
  • Another bug where empty tokens were accidentally allowed at the end of an included_range, which could lead to infinite loops in certain cases.

@maxbrunsfeld maxbrunsfeld changed the title Allow retrieving a tree's list of included ranges Allow retrieving a tree's list of included ranges, fix some included range bugs Nov 14, 2022
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.

Certain tree updates can lead to call stack exhaustion with recursive stack_node_add_link
1 participant