Skip to content

Commit

Permalink
Tweak is-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Jan 2, 2025
1 parent 6186341 commit cc13054
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Syntaxes/Text/Text (Jinja).sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,8 @@ contexts:
scope: keyword.operator.word.jinja keyword.operator.iteration.in.jinja
- match: (?:and|or|not)\b
scope: keyword.operator.word.jinja keyword.operator.logical.jinja
- match: (is)(?:\s+(not))?\b
captures:
1: keyword.operator.word.jinja keyword.operator.logical.jinja
2: keyword.operator.word.jinja keyword.operator.logical.jinja
- match: is\b
scope: keyword.operator.word.jinja keyword.operator.logical.jinja
push: expect-test-function
# symbolic operators
- match: \~
Expand All @@ -434,6 +432,8 @@ contexts:
scope: punctuation.separator.sequence.jinja

expect-test-function:
- match: not\b
scope: keyword.operator.word.jinja keyword.operator.logical.jinja
- match: '{{builtin_tests}}\b'
scope: meta.function-call.identifier.jinja support.function.test.jinja
set: function-call-argument-list
Expand Down
5 changes: 5 additions & 0 deletions Syntaxes/Text/syntax_test_scopes.jinja.txt
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,16 @@ not a # for statement:
## Issue #6

{% if test is false %}
## ^^ keyword.operator.logical.jinja
## ^^^^^ support.function.test.jinja

{% if test eq false %}
## ^^^^^ constant.language.boolean.false.jinja

{% if 1 is in [1, 2] %}
## ^^ keyword.operator.logical.jinja
## ^^ support.function.test.jinja

{% if 1 in [1, 2] %}
## ^^ keyword.operator.iteration.in.jinja

Expand Down

0 comments on commit cc13054

Please sign in to comment.