-
Notifications
You must be signed in to change notification settings - Fork 42
Add bracket forms #170
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
Merged
Merged
Add bracket forms #170
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
Use the simpler definition of argument_list for tuple_expression and remove argument_list. Don't alias closed_assignment to either named_field or named_argument.
Use _bracket_form to simplify the definition of: - Bindings: `let` and `do`. - Collections: vectors, tuples and parens. - Expressions: ternary and arrow function expressions.
- Remove `call` precedence - Remove `postfix` precedence
- Add `_qualified_macro_identifier` rule. - Rename `scoped_identifier` to `_scoped_identifier`, and alias it to `field_expression` or `import_path` where appropiate. - Refactor `_scoped_identifier` to not be recursive.
c3ea5e1
to
ef837f8
Compare
Hi @amaanq, I'm getting a failure on (Running the tests locally also works fine) EDIT: Generating with 0.24 works fine, so I'm keeping that version. |
- Replace `_comprehension_clause` with `generator` - Place the _bracket_form inside the generator (instead of having the comprehension clause as a sibling in the parse tree).
Closed
aviatesk
added a commit
to aviatesk/zed-julia
that referenced
this pull request
May 28, 2025
`scoped_identifier` has been removed within tree-sitter/tree-sitter-julia#170. Also tweaks multiline comment ending pattern so that it does not insert unnecessary extra whitespace.
aviatesk
added a commit
to aviatesk/zed-julia
that referenced
this pull request
May 29, 2025
`scoped_identifier` has been removed within tree-sitter/tree-sitter-julia#170. Also tweaks multiline comment ending pattern so that it does not insert unnecessary extra whitespace.
piechologist
added a commit
to JuliaEditorSupport/zed-julia
that referenced
this pull request
May 29, 2025
Update tree-sitter-julia. The new version allows `const` in `structs` among other improvements. See tree-sitter/tree-sitter-julia#170.
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.
_top_level
to_block_form
._bracket_form
.choice(expression, closed_assignment)
.let_binding
anddo_parameter_list
.let
anddo
use lists of_bracket_form
now.argument_list
, and usetuple_expression
instead.(x)
is a parenthesized expression, but in signatures it's a tuple. Giving a greater dynamic precedence to parentheses solves this problem (same as in lezer-julia).named_argument
andnamed_field
.=
inside brackets is parsed as_closed_assignment
now._block_form
inconst_statement
.macro_identifier
and_scoped_identifier
._scoped_identifier
is only used in import paths and inside macro identifiers, so it makes sense to just hide it. If@Foo.bar
ever becomes illegal syntax, then we can just remove it.Foo.@bar
).scoped_identifier
andfield_expression
#74_comprehension_clause
withgenerator
_bracket_form
inside the generator, instead of having the comprehension clause as a sibling in the parse tree.Note for editors:
named_field
,named_argument
orlet_binding
can useassignment
instead.Notes for semgrep:
let
bindings anddo
bindings the same way is easier than having separate rules for each. In all cases we need to extract a "pattern" from a_bracket_form
.