ginger icon indicating copy to clipboard operation
ginger copied to clipboard

`if foo is bar and ...` fails to parse

Open moll opened this issue 7 months ago • 0 comments

Hey!

Thanks for maintaining Ginger!

I believe there's a precedence bug parsing the following if that I'm seeing in real-life Jinja templates:

{%- if foo is bar and baz is qux %}
{%- endif %}

It warns of an unexpected "b" at column 23, i.e where baz is qux starts at. If you parenthesize the foo is bar part, it parses fine. I assume it's a precedence issue with is and and. :)

Cheers!

moll avatar Jul 31 '25 04:07 moll