Revert "fix(jinja): remove crashing pattern"

This reverts commit 8c8742871a.
This commit is contained in:
Robert Muir 2025-07-21 11:49:54 -04:00 committed by Christian Clason
parent 05f2910355
commit a4fa3e2d18
2 changed files with 27 additions and 8 deletions

View file

@ -125,14 +125,14 @@
"."
(identifier)+ @variable.member)
; crashes parser: https://github.com/cathaysia/tree-sitter-jinja/issues/37
; ; jinja filters
; (binary_expression
; (binary_operator
; "|")
; (unary_expression
; (primary_expression
; (identifier) @function.call)))
; jinja filters
(binary_expression
(binary_operator
"|")
(unary_expression
(primary_expression
(identifier) @function.call)))
(inline_trans
"_" @function.builtin)

View file

@ -0,0 +1,19 @@
{{ name|striptags|title }}
{# ^^^^ @variable #}
{# ^^^^^ @function.call #}
{# ^^^^^ @function.call #}
{{ listx|join(', ') }}
{# ^^^^^ @variable #}
{# ^^^^ @function.call #}
{# ^^^^ @string #}
{{ listx|join(str) }}
{# ^^^^^ @variable #}
{# ^^^^ @function.call #}
{# ^^^ @variable.parameter #}
{{ foo.bar|random }}
{# ^^^ @variable #}
{# ^^^ @variable.member #}
{# ^^^^^^ @function.call #}