Skip to content

Commit 0f67859

Browse files
committed
fix: align identifiers to query.c parser logic
Namely, they cannot have `$`, but they can contain `?` or `!` https://github.com/tree-sitter/tree-sitter/blob/4339b0fe05b264082bd159a77b21fc5d586c3a29/lib/src/query.c#L403C1-L418C2
1 parent 8bf3112 commit 0f67859

File tree

3 files changed

+32
-30
lines changed

3 files changed

+32
-30
lines changed

grammar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const PREC = {
1010
WILDCARD_NODE: 1,
1111
};
1212

13-
// Identifiers cannot start with `.`
14-
const IDENTIFIER = /[a-zA-Z0-9\-_\$][a-zA-Z0-9.\-_\$]*/;
13+
// Identifiers cannot start with `.`, `?`, or `!`
14+
const IDENTIFIER = /[a-zA-Z0-9\-_][a-zA-Z0-9.\-_?!]*/;
1515

1616
module.exports = grammar({
1717
name: "query",

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/parser.c

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

0 commit comments

Comments
 (0)