Syntax error when using `is defined` with a `filter`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
No source file or test is named. Start by reproducing the Java parser failure with the provided template and binding, then trace parsing of a filter expression followed by is defined; done means the unparenthesized form parses and behaves like the parenthesized Python Jinja form.
Written by the indexing model from the issue text.
Description
Template:
{% if value_json.name | first is defined %}a{% else %}b{% endif %}
With binding:
{
"name": [ "c" ]
}
raises com.hubspot.jinjava.interpret.FatalTemplateErrorsException: Error parsing 'value_json.name | first is defined': syntax error at position 27, encountered 'is', expected '}'
This works in Python Jinja. I can work around with parentheses:
{% if (value_json.name | first) is defined %}a{% else %}b{% endif %}
- Dominant language
- Java
- Stars
- 785
- Forks
- 184
- Avg merge
- 6d 22h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HubSpot/jinjava
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Jinjava 3.0 Open
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Openbug frontend maui-pilot
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/eo-graphs#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100