Skip to content

parse error on if statement with negated variable #83

@CuriousRichard

Description

@CuriousRichard

It seems like negated if statements don’t work like I expected. I have

{%- if not variablename -%} thenclause {%- else -%} elseclause {%- endif -%}

which I believe to be valid Jinja2, but I get a parse error at the first character of my variable.
It appears that this is fixable with parenthesis around the variable name, or removing the not and
switching the clauses. Is there a way to make Ginger accept this without changes?.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions