Skip to content

Commit

Permalink
Allow trailing commas in module and function invocation arguments
Browse files Browse the repository at this point in the history
Resolves #10
  • Loading branch information
bollian committed Feb 7, 2024
1 parent fb43491 commit 8af3261
Show file tree
Hide file tree
Showing 5 changed files with 2,602 additions and 2,371 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ module.exports = grammar({
field('name', $.identifier),
field('arguments', $.arguments),
),
arguments: $ => parens(commaSep(choice($.expression, $.assignment))),
arguments: $ => parens(commaSep(choice($.expression, $.assignment), true)),

parenthesized_assignments: $ => parens(commaSep($.assignment)),
parenthesized_expression: $ => parens($.expression),
Expand Down
12 changes: 12 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,18 @@
}
]
}
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
}
]
},
Expand Down
Loading

0 comments on commit 8af3261

Please sign in to comment.