A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jinja2cpp/Jinja2Cpp/issues/180 below:

Cannot loop some expressions in `for` that Jinja2 can · Issue #180 · jinja2cpp/Jinja2Cpp · GitHub

Hi, I have tried a set of expressions which are not currently working as expected.

1. {% for v in [1, 2] %}{{v}}{% endfor %}
2. {% for v in [1, 2]+[3, 4] %}{{v}}{% endfor %}
3. {% for v in "ab" %}{{v}}{% endfor %}
4. {% for v in "ab"+"cd" %}{{v}}{% endfor %}
5. {% for v in 'a' ~ 'b' %}{{v}}{% endfor %}

According to Jinja2:

1. 12
2. 1234
3. ab
4. abcd
5. ab

In Jinja2cpp, I find only the first one is working, the other 4 evaluate as empty.

I believe that 3 4 and 5 are because it's not handled to loop over characters.
Regarding 2, I'm under impression it's the + operation not supported for concatenating lists. (possibly in scope of issue #135)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4