Repository navigation
Store a mapping to ensure no two symbols map to the same metadata - #500
Merged
Merged
Conversation
Contributor
Author
|
/cc @tclem - This PR fixes that issue that we worked around in |
maxbrunsfeld
added a commit
to tree-sitter/node-tree-sitter
that referenced
this pull request
Dec 6, 2019
maxbrunsfeld
added a commit
that referenced
this pull request
Jan 27, 2020
Previously, this didn't correctly handle the case where *multiple* symbols were all simply-aliased to the same *other* symbol. Refs #500
tmiland
pushed a commit
to atomeditor-io/node-tree-sitter
that referenced
this pull request
Sep 29, 2026
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.
This PR ensures that the
ts_node_symbolandts_language_symbol_for_nameAPIs will always maintain a 1:1 correspondence between numeric symbols and names.Previously, when aliases were used in certain ways (see #197), it was possible for two numeric symbols to have the same public-facing node type. One place this is currently visible is in the Python grammar, in the
parenthesized_expressionrule, due to this alias.Similarly to #334, #469, and #475, there are ABI compatibility concerns surrounding this change, so the feature is gated behind a
--next-abifeature flag to thegeneratecommand. Like those other PRs, this PR adds support for the behavior in the runtime, but does not change the output oftree-sitter generatefor now. Very soon, I'm going to enable this whole batch of features by default, and bump the ABI versions of newly generated parsers. Then, we will be able to start taking advantage of this change.