Skip to content

Conversation

gregnazario
Copy link

No description provided.

@gregnazario gregnazario requested a review from Copilot July 13, 2025 05:29
Copy link

@Copilot Copilot AI left a 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 new visibility 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 to some_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 like param_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
Copy link

Copilot AI Jul 13, 2025

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.

Suggested change
'..' // 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant