Skip to content
New issue

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

Support {% elif %} #21

Open
funkybob opened this issue Jun 2, 2019 · 0 comments
Open

Support {% elif %} #21

funkybob opened this issue Jun 2, 2019 · 0 comments

Comments

@funkybob
Copy link
Owner

funkybob commented Jun 2, 2019

If if were altered to be a container of terms, each with its own condition and nodelist, rendering an if becomes iterating the terms to find the first whose condition is True.

And if and elif are effectively the same as far as a term goes. An else is a term whose condition is always True.

Alternatively, because of how parsing works, each ElseIf could consume its follower, and rendering simply becomes "if my condition is true, render me, else render my follower."

This could make long if/elif chains slow.

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

No branches or pull requests

1 participant