Skip to content

Commit

Permalink
revert: fix: disallow empty groupings, alternations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ribru17 authored and clason committed Nov 11, 2024
1 parent d0d9126 commit a6674e2
Show file tree
Hide file tree
Showing 4 changed files with 3,273 additions and 2,732 deletions.
4 changes: 2 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ module.exports = grammar({
string_content: $ => repeat1(choice(token.immediate(prec(PREC.STRING, /[^"\\]+/)), $.escape_sequence)),
parameters: $ => repeat1(choice($.capture, $.string, $._node_identifier)),
comment: _ => token(prec(PREC.COMMENT, seq(";", /.*/))),
list: $ => seq("[", repeat1($.definition), "]", quantifier($), captures($)),
list: $ => seq("[", repeat($.definition), "]", quantifier($), captures($)),

grouping: $ => seq(
"(",
repeat1(seq($._group_expression, optional("."))),
repeat(seq($._group_expression, optional("."))),
")",
quantifier($),
captures($),
Expand Down
4 changes: 2 additions & 2 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a6674e2

Please sign in to comment.