Skip to content

Commit

Permalink
fix: allow "not in" & "is not" to be queried
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed May 30, 2024
1 parent 8755c5c commit a460edf
Show file tree
Hide file tree
Showing 7 changed files with 54,403 additions and 58,648 deletions.
8 changes: 6 additions & 2 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ module.exports = grammar({
field('argument', $.primary_expression),
)),

_not_in: _ => seq('not', 'in'),

_is_not: _ => seq('is', 'not'),

comparison_operator: $ => prec.left(PREC.compare, seq(
$.primary_expression,
repeat1(seq(
Expand All @@ -819,9 +823,9 @@ module.exports = grammar({
'>',
'<>',
'in',
alias(seq('not', 'in'), 'not in'),
alias($._not_in, 'not in'),
'is',
alias(seq('is', 'not'), 'is not'),
alias($._is_not, 'is not'),
)),
$.primary_expression,
)),
Expand Down
2 changes: 2 additions & 0 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@
"is"
"not"
"or"
"is not"
"not in"
] @operator

[
Expand Down
52 changes: 30 additions & 22 deletions src/grammar.json

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

18 changes: 10 additions & 8 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 a460edf

Please sign in to comment.