We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Appears to work in Python jinja2, and there's a Note that mentions it in this section in the docs. https://jinja.palletsprojects.com/en/2.10.x/templates/#literals
Here's a template example that works in Python and crashes on "Load" today.
{% set foo = None %} {% if foo != None %} 1 {% else %} None {% endif %} {% set bar = 1 %} {% if bar != None %} 1 {% else %} None {% endif %} {% set baz = none %} {% if baz != none %} 1 {% else %} none {% endif %} {% set qux = 1 %} {% if qux != none %} 1 {% else %} none {% endif %}
This code change seemed to do the trick for me and seems to produce the correct output and no longer crash.
diff --git a/jinja2cpp/src/expression_parser.cpp b/jinja2cpp/src/expression_parser.cpp --- a/jinja2cpp/src/expression_parser.cpp +++ b/jinja2cpp/src/expression_parser.cpp @@ -326,6 +326,8 @@ return std::make_shared<ConstantExpression>(InternalValue(true)); case Token::False: return std::make_shared<ConstantExpression>(InternalValue(false)); + case Token::None: + return std::make_shared<ConstantExpression>(InternalValue(EmptyValue())); case '(': valueRef = ParseBracedExpressionOrTuple(lexer); break;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Appears to work in Python jinja2, and there's a Note that mentions it in this section in the docs.
https://jinja.palletsprojects.com/en/2.10.x/templates/#literals
Here's a template example that works in Python and crashes on "Load" today.
This code change seemed to do the trick for me and seems to produce the correct output and no longer crash.
The text was updated successfully, but these errors were encountered: