Skip to content

Commit a460edf

Browse files
fix: allow "not in" & "is not" to be queried
1 parent 8755c5c commit a460edf

File tree

7 files changed

+54403
-58648
lines changed

7 files changed

+54403
-58648
lines changed

grammar.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,10 @@ module.exports = grammar({
806806
field('argument', $.primary_expression),
807807
)),
808808

809+
_not_in: _ => seq('not', 'in'),
810+
811+
_is_not: _ => seq('is', 'not'),
812+
809813
comparison_operator: $ => prec.left(PREC.compare, seq(
810814
$.primary_expression,
811815
repeat1(seq(
@@ -819,9 +823,9 @@ module.exports = grammar({
819823
'>',
820824
'<>',
821825
'in',
822-
alias(seq('not', 'in'), 'not in'),
826+
alias($._not_in, 'not in'),
823827
'is',
824-
alias(seq('is', 'not'), 'is not'),
828+
alias($._is_not, 'is not'),
825829
)),
826830
$.primary_expression,
827831
)),

queries/highlights.scm

+2
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@
9696
"is"
9797
"not"
9898
"or"
99+
"is not"
100+
"not in"
99101
] @operator
100102

101103
[

src/grammar.json

+30-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

+10-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)