Skip to content

Commit

Permalink
fix: array expressions with attributes after the first item
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Nov 17, 2023
1 parent 48e0533 commit 9621d3e
Show file tree
Hide file tree
Showing 4 changed files with 82,777 additions and 82,152 deletions.
9 changes: 7 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ const primitive_types = numeric_types.concat(['bool', 'str', 'char']);
module.exports = grammar({
name: 'rust',

extras: $ => [/\s/, $.line_comment, $.block_comment],
extras: $ => [
/\s/,
$.line_comment,
$.block_comment,
],

externals: $ => [
$._string_content,
Expand Down Expand Up @@ -102,6 +106,7 @@ module.exports = grammar({
[$.parameters, $._pattern],
[$.parameters, $.tuple_struct_pattern],
[$.type_parameters, $.for_lifetimes],
[$.array_expression],
],

word: $ => $.identifier,
Expand Down Expand Up @@ -1065,7 +1070,7 @@ module.exports = grammar({
field('length', $._expression),
),
seq(
sepBy(',', $._expression),
sepBy(',', seq(repeat($.attribute_item), $._expression)),
optional(','),
),
),
Expand Down
35 changes: 31 additions & 4 deletions src/grammar.json

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

Loading

0 comments on commit 9621d3e

Please sign in to comment.