Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python parity bug(?): Comma-delimited expression #263

Open
tjsmith-meta opened this issue Sep 23, 2024 · 0 comments
Open

Python parity bug(?): Comma-delimited expression #263

tjsmith-meta opened this issue Sep 23, 2024 · 0 comments

Comments

@tjsmith-meta
Copy link

tjsmith-meta commented Sep 23, 2024

The following template compiles with Python jinja2 (and yields an output of "1"), but does not work with jinja2cpp.

{% if 0, 'foo' != 'bar' %}
1
{% endif %}

Here's the jinja2cpp error that I get.

LOAD ERROR: noname.j2tpl:2:8: error: Expected end of statement, got: ','
{% if 0, 'foo' != 'bar' %}
    ---^-------

I'm actually not entirely sure what this expression is supposed to mean, or if it is just incidentally supported due to the Python jinja2 implementation.

I was not able to find an explicit call out for what this would mean in the documentation, and I wasn't able to discern how this might be useful from mucking around experimentally with a variety of values.
https://jinja.palletsprojects.com/en/2.10.x/templates/

So unclear if it would make sense to fix in jinja2cpp for parity, or if Python jinja2 should be fixed to not support this "bad template syntax".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant