Skip to content

Commit

Permalink
Allow optional trailing , in lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Nov 1, 2023
1 parent 91e8f94 commit cff1fea
Show file tree
Hide file tree
Showing 3 changed files with 62,887 additions and 62,786 deletions.
6 changes: 5 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,11 @@ module.exports = grammar({
choice(alias($._inner_list_spread, $.spread), $._expr),

_inner_list: $ =>
seq(repeat(seq($._inner_list_item, ",")), $._inner_list_item),
seq(
repeat(seq($._inner_list_item, ",")),
$._inner_list_item,
optional(","),
),

list: $ => seq("[", optional($._inner_list), "]"),

Expand Down
12 changes: 12 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -3916,6 +3916,18 @@
{
"type": "SYMBOL",
"name": "_inner_list_item"
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
}
]
},
Expand Down
Loading

0 comments on commit cff1fea

Please sign in to comment.