Cannot loop some expressions in for that Jinja2 can (original) (raw)

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)