-
Notifications
You must be signed in to change notification settings - Fork 33
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
Refactor! #153
Open
savq
wants to merge
11
commits into
tree-sitter:master
Choose a base branch
from
savq:lezer
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
Refactor! #153
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
savq
force-pushed
the
lezer
branch
2 times, most recently
from
September 27, 2024 19:45
30bfa5d
to
8373ced
Compare
Not sure why inlining changes the behavior of the parser, but `_top_level` has to be inlined, otherwise everything breaks.
- Remove `type_clause` rule - Remove `type_parameter_list` aliases - Update and organize tests for type definitions - Add query patterns for `where_expression` and subtyping operators
- Simplify `signature` definition - Remove `return_type` and `where_clause` hacks
- Arrow functions cannot contain open tuples, so they should only allow closed assignments (like `let_statement`). - Rename `function_expression` to `arrow_function_expression`.
Parse the start of block_comment as a regular token.
Parse the start of a string as a regular token, and then parse the content of the string using the external tokenizer. This requires rules for all types of content (string/command, normal/raw, single/triple), but it doesn't require using the external tokenizer to serialize string delimiters.
- Remove unnecessary newlines from `_comprehension_clause` and `matrix_expression`. - Update definition of `_terminator`. Co-authored-by: Imran Khan <[email protected]>
- Rename `addDots` to `addDot`. - Move `token` call to `addDot` definition.
- Add `public_statement` - Split import rule into `import_statement` and `using_statement`
savq
force-pushed
the
lezer
branch
2 times, most recently
from
October 8, 2024 21:11
2ddd692
to
32c4606
Compare
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.
Various changes based on the lezer-julia rewrite.
_top_level
rule_top_level
breaks the parser, which is probably a tree-sitter bug, because inlining shouldn't affect the semantics of the grammar.type_head
rulefor
andstruct
grammar with headers? #142signature
rulefor_binding
operators visiblefunction_expression
toarrow_function_expression
arrow_function_expression
allowing assignments with open tuplesa -> a = 2, 3
parsed as a lambda expression instead of a tuple #151block_comment
public_statement
import_statement
andusing_statement
TODO: Generate with tree-sitter v0.24 and release
Notes for downstream:
The way type definitions are parsed now probably breaks existing
locals.scm
, and makes querying type name more complicated. The only upside is that patterns written fortype_head
apply to all abstract/primitive/struct definitions.