-
-
Notifications
You must be signed in to change notification settings - Fork 17
Consider custom iterator for captures #30
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
Comments
|
@topi314 ok so in my PR i put the iterator on the query cursor, instead of the matches/captures result but that introduces a name collision, so I called them IterMatches/Captures WDYT of that? |
not ideal, but I'd prob go with |
Maybe @amaanq is amenable to a breaking change? |
I think it's fine. |
Uh oh!
There was an error while loading. Please reload this page.
The pattern for iterating captures with go-tree-sitter looks like this
This is fine, but perhaps we can use go's custom iterators (since 1.23) to nice it up a bit:
This wouldn't have to replace the Next() method, it could just be a more ergonomic API for users that want it.
this (basically pseudocode) might do the job:
The text was updated successfully, but these errors were encountered: