Skip to content
This repository was archived by the owner on Jun 1, 2022. It is now read-only.

Commit 99ba8d3

Browse files
authored
[#58] Allow empty list and tuple patterns (#59)
1 parent 267e4df commit 99ba8d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

grammar.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ module.exports = grammar({
139139
)),
140140
map_pattern: $ => prec(PREC.PATTERN, seq(
141141
'{',
142-
commaSep1(choice($.pattern_pair, $.shorthand_pair_identifier_pattern)),
142+
commaSep(choice($.pattern_pair, $.shorthand_pair_identifier_pattern)),
143143
optional(seq(',', alias($.rest, $.rest_map))),
144144
'}'
145145
)),
@@ -154,7 +154,7 @@ module.exports = grammar({
154154
)),
155155
list_pattern: $ => prec(PREC.PATTERN, seq(
156156
'[',
157-
commaSep1($.pattern),
157+
commaSep($.pattern),
158158
optional(seq(',', alias($.rest, $.rest_list))),
159159
']'
160160
)),
@@ -275,8 +275,8 @@ module.exports = grammar({
275275
seq('[', field('right', $._simple_expression), ']'),
276276
field('right', choice(
277277
alias($.identifier, $.shorthand_access_identifier),
278-
$.number)
279-
)
278+
$.number
279+
))
280280
)
281281
)),
282282

0 commit comments

Comments
 (0)