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

Updates #35

Closed
wants to merge 58 commits into from
Closed

Updates #35

wants to merge 58 commits into from

Conversation

amaanq
Copy link
Member

@amaanq amaanq commented May 22, 2024

Mostly changes I consider to be more correct/appropriate

steelsojka and others added 30 commits July 28, 2020 07:04
…cate-args

fix(grammar): allow identifiers in predicate args
fix(grammar): fix string to not be greedy
feat(grammar): immediate child operator
Allow to escape strings
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) .)
```
* 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
@amaanq
Copy link
Member Author

amaanq commented May 22, 2024

screwed it up 😅

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.

9 participants