-
Notifications
You must be signed in to change notification settings - Fork 15
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
Updates #35
Conversation
This file contains 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
…cate-args fix(grammar): allow identifiers in predicate args
fix(grammar): fix string to not be greedy
feat(grammar): immediate child operator
Strings can be have escaped `\"`, just implemented it in the same way js does https://github.com/tree-sitter/tree-sitter-javascript/blob/3f8b62f9befd3cb3b4cb0de22f6595a0aadf76ca/grammar.js#L827
Allow to escape strings
Fix: allow ; in strings
Add license
Update to tree-sitter-cli 0.19.1 Co-authored-by: Santos Gallegos <[email protected]>
* Allow anonymous nodes in immediate child expressions Currently this makes the playground report a syntax error here https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/111cf356fd5c6c52d2dfb9299a76d201624be3cc/queries/python/textobjects.scm#L45 * Rewrite immediate child operator - Don't group nodes in the immediate child operator, just treat it as another operator. - Better parsing of expressions by separating group and named node expressions This allows to stop parsing invalid expressions like ```scm [(one) . (two)] [. (one) (two) .] [. (one) (two)] [(one) (two) .] ((one) (two) .) (. (one) (two) .) (. (one) (two) .) ```
These are valid https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/111cf356fd5c6c52d2dfb9299a76d201624be3cc/queries/dart/textobjects.scm#L43-L48 Also added parsing some examples to the tests. It's suppose that these queries should be valid :)
* Support negated fields and some fixes Support for negated fields https://tree-sitter.github.io/tree-sitter/using-parsers#negated-fields. And added support to match the `#` from the predicate name. And fixed the parsing of the capture name and predicates, it was matching `@ name` and `#predicate !`, those are invalid names. * Remove support for old predicate form Predicates should always start with `#`. * Allow top level fields
As mentioned in tree-sitter/tree-sitter#1629 (comment).
SPM support
Remove redundant functions
Update dependencies
Add `/` to valid `IDENTIFIER` to support `foo/bar` supertype nodes in queries, e.g., for Haskell. Followup could add dedicated support for such nodes (if there is a use case).
screwed it up 😅 |
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.
Mostly changes I consider to be more correct/appropriate