-
Notifications
You must be signed in to change notification settings - Fork 127
feat!: ABI 15 & QueryCursor #333
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
Open
ObserverOfTime
wants to merge
5
commits into
master
Choose a base branch
from
0.25
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
ChrisFloofyKitsune
approved these changes
Mar 9, 2025
In my opinion, methods that in C return iterator structs should in Python return simple Lists of values. It will likely be more efficient, because crossing the Python to C border is expensive. It’s also simpler from an API perspective. |
@maxbrunsfeld Can I have admin rights to this repo (like the Java and Kotlin ones) so I can actually merge PRs? |
This comment was marked as resolved.
This comment was marked as resolved.
Open
2 tasks
haxtibal
added a commit
to haxtibal/tree-sitter-robot
that referenced
this pull request
May 1, 2025
On publish, the pypi workflow currently regenerates our parser for ABI 15 because that's the default from the central workflow [1]. In Python, one needs py-tree-sitter [2] to load the robot language. Since py-tree-sitter folks have not yet finished ABI 15 migration, there's currently no way to load our binding. Using the lattest py-tree-sitter 0.24 would fail with "ValueError: Incompatible Language version 15. Must be between 13 and 14". Therefore to make tree-sitter-robot available for users, we enforce ABI 14 on regeneration for upload. PS: Some of the central language bindings have basically the same problem. However, since they have published former pypi releases with lower ABI versions, there's something users can fallback to. We don't have previous releases, so no fallback is available. [1] https://github.com/tree-sitter/workflows/blob/ec44bc4f4667a458dd397ed9864f1b560e8fdca2/.github/workflows/package-pypi.yml#L24 [2] https://github.com/tree-sitter/py-tree-sitter [3] tree-sitter/py-tree-sitter#333
haxtibal
added a commit
to haxtibal/tree-sitter-robot
that referenced
this pull request
May 1, 2025
On publish, the pypi workflow currently regenerates our parser for ABI 15 because that's the default from the central workflow [1]. In Python, one needs py-tree-sitter [2] to load the robot language. Since py-tree-sitter folks have not yet finished ABI 15 migration [3], there's currently no way to load our binding. Using the lattest py-tree-sitter 0.24 would fail with "ValueError: Incompatible Language version 15. Must be between 13 and 14". Therefore to make tree-sitter-robot available for users, we enforce ABI 14 on regeneration for upload. PS: Some of the central language bindings have basically the same problem. However, since they have published former pypi releases with lower ABI versions, there's something users can fallback to. We don't have previous releases, so no fallback is available. [1] https://github.com/tree-sitter/workflows/blob/ec44bc4f4667a458dd397ed9864f1b560e8fdca2/.github/workflows/package-pypi.yml#L24 [2] https://github.com/tree-sitter/py-tree-sitter [3] tree-sitter/py-tree-sitter#333
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.
Breaking changes are marked with !.
Additions:
Language.name
(getter)Language.abi_version
(getter)Language.semantic_version
(getter)Language.supertypes
(getter)Language.subtypes(supertype)
Node.first_child_for_byte(byte)
Node.first_named_child_for_byte(byte)
Query.string_count
(getter)Query.capture_name(index)
Query.capture_quantifier(pattern_index, capture_index)
Query.string_value(index)
QueryCursor(query)
QueryCursor.match_limit
(getter, setter, deleter)QueryCursor.timeout_micros
(getter, setter, deleter)QueryCursor.did_exceed_match_limit
(getter)QueryCursor.set_max_start_depth(depth)
QueryCursor.set_byte_range(start, end)
QueryCursor.set_point_range(start, end)
QueryCursor.captures(node, predicate, progress_callback)
QueryCursor.matches(node, predicate, progress_callback)
LookaheadIterator.names()
LookaheadIterator.symbols()
Deprecations:
Language.version
: useLanguage.abi_version
Language.query(source)
: useQuery(language, source)
Parser.timeout_micros
: use theprogress_callback
inparse()
QueryCursor.timeout_micros
: use theprogress_callback
inmatches()
orcaptures()
Removals:
Node.child_containing_descendant(descendant)
: useNode.child_with_descendant(descendant)
!Query.match_limit
: moved toQueryCursor.match_limit
!Query.set_match_limit(limit)
: moved toQueryCursor.match_limit
!Query.did_exceed_match_limit
: moved toQueryCursor.did_exceed_match_limit
!Query.timeout_micros
: moved toQueryCursor.timeout_micros
!Query.set_timeout_micros(timeout)
: moved toQueryCursor.timeout_micros
!Query.set_max_start_depth(depth)
: moved toQueryCursor.set_max_start_depth(depth)
!Query.set_byte_range(byte_range)
: moved toQueryCursor.set_byte_range(start, end)
!Query.set_point_range(point_range)
: moved toQueryCursor.set_point_range(start, end)
!Query.captures(node, predicate)
: moved toQueryCursor.captures(node, predicate, progress_callback)
!Query.matches(node, predicate)
: moved toQueryCursor.matches(node, predicate, progress_callback)
!LookaheadIterator.iter_names()
: useLookaheadIterator.names()
!Changes:
Parser.parse()
:encoding
parameter also accepts"utf16le"
&"utf16be"
Parser.parse()
: addedprogress_callback
parameterLookaheadIterator.__next__()
: yieldstuple[int, str]
!LookaheadIterator.reset(state, language)
: renamed fromreset_state
!