-
Notifications
You must be signed in to change notification settings - Fork 53
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
Upgrade to treesitter 0.24.2 #154
Closed
afroozeh
wants to merge
25
commits into
fwcd:main
from
gitarcode:afroozeh/upgrade-to-treesitter-0.24.2
Closed
Upgrade to treesitter 0.24.2 #154
afroozeh
wants to merge
25
commits into
fwcd:main
from
gitarcode:afroozeh/upgrade-to-treesitter-0.24.2
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
We need to expose null literals in parse trees, otherwise, it will not be possible to syntactically differentiate between some constructs. Example: currently, these two functions yield the same parse tree: ``` fun f() = null fun f() { } ``` ``` source_file function_declaration simple_identifier function_value_parameters function_body ``` With the changes in this PR, the first function will have a `null_literal` in the tree: ``` source_file function_declaration simple_identifier function_value_parameters function_body null_literal ```
Currently, it is rather cumbersome to detect the 'else' part of an 'if-else' construct in the parse tree because the 'else' part is flattened. This PR makes the parse tree more explicit by having nested else nodes. This would simplify matching the 'else' part.
## Description This PR adds fields for property_declaration ## Test Plan passes existing tests ## Revert Plan revert diff
This PR exposes the `block` node as a visible node in the parse tree. Without that, we need to rely on `statements` and some other checks to find blocks which is very cumbersome and error-prone.
## Description Add more fields to the grammar ## Test Plan Added modifiers to the tests ## Revert Plan revert diff
This PR expose 'function_value_parameter' as a grammar node, as it was originally in the reference grammar. Otherwise, translating the parameters is difficult because the default value initializer is in `function_value_parameter`.
Add fields for class_parameters
Merge upstream main The only real change is ``` null_literal: $ => seq( "null" ), ``` became: ``` null_literal: $ => "null", ```
## Description - Upgrades to tree-sitter 0.23.0 and regenerates the bindings. - Shows fields by default in tests (new feature in tree-sitter 0.23.0). - Uses standard CI actions and adds the Kotlin compiler repo for testing samples. ## Test Plan unit tests ## Revert Plan None, forward fix.
Cherry-pick of 8c7c0ca from upstream. Before, I made `else` a nonterminal (grammar rule) but it turned out that fields are a better way to do that without altering the grammar. As a bonus, the updated grammar is in line with Java and other grammars.
Cherry-pick of #142 which fixes #127. Fixes the priority of arguments in calls. `with(s) { length }` should be parsed as `with ((s), { length }) ``` (source_file (call_expression (simple_identifier) (call_suffix (value_arguments (value_argument (simple_identifier))) (annotated_lambda (lambda_literal (statements (simple_identifier))))))) ``` And not as `(with (s)) { length})` ``` (source_file (call_expression (call_expression (simple_identifier) (call_suffix (value_arguments (value_argument (simple_identifier))))) (call_suffix (annotated_lambda (lambda_literal (statements (simple_identifier))))))) ```
Removed the Kotlin repo from the list of repos, as it has many examples of non-parsable files, and added the following repos instead: - https://github.com/square/okhttp.git - https://github.com/ktorio/ktor.git - https://github.com/square/leakcanary.git - https://github.com/JetBrains/compose-multiplatform.git - https://github.com/Kotlin/kotlinx.coroutines.git
Fields for `catch_block` and `for_statement`.
Fields for lambda
Adds more fields to the grammar.
Adds support for Kotlin functional interfaces.
Updates the `import_header` rule with some fields and other improvements.
Add fields for prefix and postfix expressions
github-actions
bot
added
ci-cd
CI/CD-related
grammar
Related to the grammar
bindings
Related to the Node.js/Rust/C bindings
labels
Oct 9, 2024
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.
No description provided.