Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#261 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Reproduce the two macro examples from the issue and compare their compilation behavior in Jinja2Cpp with Python jinja2. Trace how the parser handles the in operator and its not in variant; done means the second template compiles and behaves consistently with the first and with Python jinja2.

Written by the indexing model from the issue text.

Description

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!

Dominant language
C++
Stars
600
Forks
114
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jinja2cpp/Jinja2Cpp

All issues in jinja2cpp/Jinja2Cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.