jinja2cpp / jinja2cpp/Jinja2Cpp

Python parity bug(?): Comma-delimited expression

Open
#263 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
600
Forks
114
PR merge metrics
No merged PRs in 30d

Description

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".

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.