Skip to content

Commit cdda7ed

Browse files
ribru17clason
authored andcommitted
fix!: don't parse unquoted predicate args specially
Before this change, a bare `_` identifier inside a predicate would be tokenized as `"_"`. This change makes it so that all unquoted arguments (which must be valid identifiers) are marked as `(identifier)`. This is breaking because `"_"` can no longer be queried inside parameter nodes.
1 parent eeac2b7 commit cdda7ed

File tree

5 files changed

+859
-792
lines changed

5 files changed

+859
-792
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module.exports = grammar({
6666
token.immediate('"'),
6767
),
6868
string_content: $ => repeat1(choice(token.immediate(prec(PREC.STRING, /[^"\\\n]+/)), $.escape_sequence)),
69-
parameters: $ => repeat1(choice($.capture, $.string, $._node_identifier)),
69+
parameters: $ => repeat1(choice($.capture, $.string, $.identifier)),
7070
comment: _ => token(prec(PREC.COMMENT, seq(";", /.*/))),
7171
list: $ => seq("[", repeat1($.definition), "]", suffix($)),
7272

src/grammar.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)