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

Refactor! #153

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Refactor! #153

wants to merge 11 commits into from

Conversation

savq
Copy link
Collaborator

@savq savq commented Sep 21, 2024

Various changes based on the lezer-julia rewrite.

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 for type_head apply to all abstract/primitive/struct definitions.

@savq savq force-pushed the lezer branch 2 times, most recently from 30bfa5d to 8373ced Compare September 27, 2024 19:45
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.
savq and others added 2 commits October 2, 2024 14:24
- 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.
@savq savq marked this pull request as ready for review October 3, 2024 19:19
- Add `public_statement`
- Split import rule into `import_statement` and `using_statement`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant