diff --git a/resources/syntax/Twig.sublime-syntax b/resources/syntax/Twig.sublime-syntax index d363607..373123e 100644 --- a/resources/syntax/Twig.sublime-syntax +++ b/resources/syntax/Twig.sublime-syntax @@ -234,7 +234,7 @@ contexts: tests_body: - meta_scope: meta.function.test.twig - include: block_pop - - match: (?=\b(and|or|b-and|b-or|b-xor)\b) + - match: (?=\b(and|or|b-and|b-or|b-xor)\b|[?:]+) pop: 1 # builtin tests - match: '\bnot\b' diff --git a/resources/syntax/tests/syntax_test_html.twig b/resources/syntax/tests/syntax_test_html.twig index 8cc05e6..b861fea 100644 --- a/resources/syntax/tests/syntax_test_html.twig +++ b/resources/syntax/tests/syntax_test_html.twig @@ -582,13 +582,13 @@ |^ punctuation.definition.expression.begin.twig | ^ - variable.function.test.twig -{% if loop.index is divisible by(3) and foo == bar %}{% endif %} +{% if loop.index is divisible by(3) ? foo : bar %}{% endif %} |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.statement.twig | ^^ keyword.operator.comparison.test.twig | ^^^^^^^^^^^^ support.function.test.twig | ^^^ meta.function-call.arguments.twig | ^ constant.numeric.value.twig -| ^^^ variable.other.twig +| ^^^ variable.other.twig {# Custom test #} {{ name is weird }}