Skip to content

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

Open
mogstad wants to merge 2 commits into
ember-tooling:mainfrom
mogstad:push-nksopsusrmto
Open

Native support for else and else if in block statements#175
mogstad wants to merge 2 commits into
ember-tooling:mainfrom
mogstad:push-nksopsusrmto

Conversation

@mogstad

@mogstad mogstad commented Mar 19, 2025

Copy link
Copy Markdown

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