Skip to content

Commit 429f612

Browse files
committed
Allow trailing commas in comma-separated syntax elements
1 parent 97d0f3d commit 429f612

File tree

3 files changed

+25414
-21819
lines changed

3 files changed

+25414
-21819
lines changed

grammar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ module.exports = grammar({
805805
logicalAndExpr: $ => prec.left(PREC.AND, seq($._expr, field('operator', "&&"), $._expr)),
806806

807807
logicalOrExpr: $ => prec.left(PREC.OR, seq($._expr, field('operator', "||"), $._expr)),
808-
808+
809809
pipeExpr: $ => prec.left(PREC.PIPE, seq($._expr, field('operator', "|>"), $._expr)),
810810

811811
typeTestExpr: $ => prec(PREC.IS, seq($._expr, field("operator", "is"), $._type)),
@@ -877,7 +877,7 @@ module.exports = grammar({
877877
});
878878

879879
function commaSep1 (rule) {
880-
return seq(rule, repeat(seq(',', rule)));
880+
return seq(rule, repeat(seq(',', rule)), optional(','));
881881
}
882882

883883
function commaSep (rule) {

src/grammar.json

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)