Skip to content

Commit a6674e2

Browse files
ribru17clason
authored andcommitted
revert: fix: disallow empty groupings, alternations
This change caused some strange breaking behavior when it came to querying nodes inside lists/groupings, so best to revert it for now and potentially add it back later when the weirdness is sorted out.
1 parent d0d9126 commit a6674e2

File tree

4 files changed

+3273
-2732
lines changed

4 files changed

+3273
-2732
lines changed

grammar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ module.exports = grammar({
7575
string_content: $ => repeat1(choice(token.immediate(prec(PREC.STRING, /[^"\\]+/)), $.escape_sequence)),
7676
parameters: $ => repeat1(choice($.capture, $.string, $._node_identifier)),
7777
comment: _ => token(prec(PREC.COMMENT, seq(";", /.*/))),
78-
list: $ => seq("[", repeat1($.definition), "]", quantifier($), captures($)),
78+
list: $ => seq("[", repeat($.definition), "]", quantifier($), captures($)),
7979

8080
grouping: $ => seq(
8181
"(",
82-
repeat1(seq($._group_expression, optional("."))),
82+
repeat(seq($._group_expression, optional("."))),
8383
")",
8484
quantifier($),
8585
captures($),

src/grammar.json

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

src/node-types.json

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

0 commit comments

Comments
 (0)