-
Notifications
You must be signed in to change notification settings - Fork 5
Update to tree sitter 15 - and fix some more syntax #17
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Move tree-sitter grammar to version 15, adds support for new syntax patterns (compound assignment operators, updated cast and visibility syntax, type parameter definitions, etc.), and refreshes the test corpora to exercise those grammar changes.
- Extend grammar.json and grammar.js with compound assignment operators (+=, -=, etc.), parenthesis-free
as
casts, and newvisibility
and type parameter rules. - Update
tree-sitter.json
to point at the new schema and enable additional language bindings. - Add and refresh Move test corpus files to cover the updated syntax patterns.
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
tree-sitter.json | bumped schema URL and updated metadata/bindings |
test/corpus/test_script.move | new Move script testing arithmetic, option and vector syntax |
test/corpus/test_module_split_address.move | added test for legacy module/address split syntax |
test/corpus/test_module_no_addr.move | added test for module without top‐level address syntax |
test/corpus/test_module.move | large Move module exercising updated grammar |
test/corpus/short.move | smaller Move module testing enums, struct and match syntax |
test/corpus/script.move | basic script test for comments and placeholder main |
test/corpus/enums.move | enum and test‐only match patterns |
src/tree_sitter/parser.h | removed redundant forward typedef |
src/node-types.json | added new operator tokens and marked some fields optional |
src/grammar.json | extended JSON-based grammar with new operators, visibility, casts, type params, precedences |
grammar.js | updated JS grammar rules to match JSON changes |
Comments suppressed due to low confidence (2)
test/corpus/test_script.move:8
- [nitpick] Function names in Move are typically snake_case. Consider renaming
some_Name
tosome_name
for consistency.
fun some_Name<T: key, U: drop>(
test/corpus/test_script.move:22
- [nitpick] Parameter names should follow snake_case and be descriptive. Rename
_I_12
to something likeparam_u
or another meaningful identifier.
_I_12: U
field('field', alias($.var_name, $.shorthand_field_identifier)), | ||
seq(field('field', $.var_name), ':', field('bind', $._bind)) | ||
seq(field('field', $.var_name), ':', field('bind', $._bind)), | ||
'..' // TODO: Ensure this is only at the end of the binding |
Copilot
AI
Jul 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowing ..
anywhere in a binding may lead to ambiguous destructuring patterns. It would be safer to restrict ..
to appear only as the last member in the field list.
'..' // TODO: Ensure this is only at the end of the binding | |
// Removed standalone '..' as it is now handled in `_bind_fields` |
Copilot uses AI. Check for mistakes.
1. Fixes type declarations in function values 2. Fixes calling a function value as a function 3. Ensures tests are compilable
No description provided.