Skip to content

statements: add statement-in-elif test case#10

Open
lheckemann wants to merge 2 commits into
interdependence:mainfrom
lheckemann:push-pqytnxoptyvk
Open

statements: add statement-in-elif test case#10
lheckemann wants to merge 2 commits into
interdependence:mainfrom
lheckemann:push-pqytnxoptyvk

Conversation

@lheckemann

Copy link
Copy Markdown
Contributor

This produces a parse error in spite of being a valid template, and I don't quite understand why. Any help or a fix would be much appreciated :)

@interdependence

Copy link
Copy Markdown
Owner

It appears to happen with any statement (paired or unpaired) located inside an {% elif %} block. I will take a closer look when able.

@lheckemann
lheckemann force-pushed the push-pqytnxoptyvk branch from ba15741 to 11a2ef2 Compare May 18, 2026 09:01
@lheckemann

lheckemann commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

I took a stab in the dark and found that making the body of the elif clause mandatory "fixes" the test case, though it isn't really correct either. See latest commit in this PR.

EDIT: this doesn't help much, since it chokes in the same way on an elif clause containing content followed by a statement.

The {% token at the beginning of an {% elif %} or {% endif %} cannot be
told apart from that at the beginning of any other statement, so it's
a conflict.
@lheckemann
lheckemann force-pushed the push-pqytnxoptyvk branch from c5c4111 to 966ae54 Compare May 18, 2026 10:17
@lheckemann

Copy link
Copy Markdown
Contributor Author

Introducing a conflict instead of the precedence on elif seems to fix this properly. I'm not super confident in this, so a close look would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants