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

Native support for else and else if in block statements #175

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mogstad
Copy link

@mogstad mogstad commented Mar 19, 2025

As there isn't a native concept of if statements in the grammar, it makes it especially hard to query else if statements, as they've previously just been exposed as a helper. It makes it cumbersome to query else blocks and not possible—I think at least—to query and capture else if as the same capture.

else is supported for all block_statements in Ember, but else if isn't, but it wouldn't be valid syntax that we want to capture any other way, so I haven't tried to be cleaver about it.

I’m unsure if this is the way to solve, but I don’t think it’s unreasonable to have “native” support for it.

@mogstad mogstad force-pushed the push-nksopsusrmto branch from 3a42914 to 4c6da7b Compare March 26, 2025 15:25
As there isn't a native concept of if statements in the grammar, it
makes it especially hard to query `else if` statements, as they've
previously just been exposed as a helper. It makes it cumbersome to
query `else` blocks and not possible—I think at least—to query and
capture `else if` as the same capture.

`else` is supported for all block_statements in Ember, but `else if`
isn't, but it wouldn't be valid syntax that we want to capture any other
way, so I haven't tried to be cleaver about it.
@mogstad mogstad force-pushed the push-nksopsusrmto branch from 4c6da7b to 47f68db Compare March 26, 2025 15:27
@mogstad mogstad force-pushed the push-nksopsusrmto branch from 47f68db to 8e0ab76 Compare March 26, 2025 15:27
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.

1 participant