Skip to content

Support for "not in" syntax (works in Python jinja2) #261

Open
@tjsmith-meta

Description

@tjsmith-meta

The following template (foo in (...)) compiles fine in both Python jinja2 and Jinja2Cpp.

{% macro foo(val) %}
{{1 if val in ('', "''", 'foo')}}
{% endmacro %}

Whereas this slight variant (foo not in (...)) works only in Python jinja2.

{% macro foo(val) %}
{{1 if val not in ('', "''", 'foo')}}
{% endmacro %}

This seems like a bug that it doesn't work in Jinja2Cpp. I'm happy to make the code fix here, but would appreciate some pointers in the code as to what the fix might look like here. I suspect there may be a simple fix here. Help would be much appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions