Skip to content

Commit

Permalink
[tree_sitter_v] Support for mut is clause (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lycs-D authored Mar 31, 2024
1 parent c8346f4 commit bb6ca96
Show file tree
Hide file tree
Showing 7 changed files with 192,424 additions and 192,075 deletions.
2 changes: 2 additions & 0 deletions tree_sitter_v/bindings/node_types.v
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ pub enum NodeType {
interface_method_definition
interpolation_closing
interpreted_string_literal
is_clause
is_expression
key_value_attribute
keyed_element
Expand Down Expand Up @@ -394,6 +395,7 @@ const node_type_name_to_enum = {
'interface_method_definition': NodeType.interface_method_definition
'interpolation_closing': NodeType.interpolation_closing
'interpreted_string_literal': NodeType.interpreted_string_literal
'is_clause': NodeType.is_clause
'is_expression': NodeType.is_expression
'key_value_attribute': NodeType.key_value_attribute
'keyed_element': NodeType.keyed_element
Expand Down
5 changes: 4 additions & 1 deletion tree_sitter_v/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1190,10 +1190,13 @@ module.exports = grammar({
for_statement: ($) =>
seq(
'for',
optional(choice($.range_clause, $.for_clause, $._expression)),
optional(choice($.range_clause, $.for_clause, $.is_clause, $._expression)),
field('body', $.block),
),

is_clause: ($) =>
prec(PREC.primary, seq(optional(alias('mut', $.mutability_modifiers)), $.is_expression)),

range_clause: ($) =>
prec.left(
PREC.primary,
Expand Down
2 changes: 1 addition & 1 deletion tree_sitter_v/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"node-gyp-build": "^4.8.0"
},
"peerDependencies": {
"tree-sitter": "^0.21.0"
"tree-sitter": "^0.21.1"
},
"peerDependenciesMeta": {
"tree_sitter": {
Expand Down
34 changes: 34 additions & 0 deletions tree_sitter_v/src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions tree_sitter_v/src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bb6ca96

Please sign in to comment.