Skip to content

Conversation

@ygrx532
Copy link

@ygrx532 ygrx532 commented Nov 4, 2025

This pull request modifies the compiler support for switch statements.

Modifications

  • Introduces complete translation logic for switch statements, preserving fallthrough, break, and default behaviors.

  • Initializes control variables: switch_discriminant_, switch_fallthrough_, and switch_break_*.

  • Defines helpers for splitting at break, translating case bodies, and building conditional chains.

  • Ensures each case conditionally executes based on the discriminant, fallthrough, and break flags, with deferred evaluation of break to maintain semantic correctness.

* feat: add ast node for switch statement

* feat: naive switch with fallthrough

* feat: switch case support with break

* feat: refactor code for simplicity
@ygrx532 ygrx532 requested a review from a team as a code owner November 4, 2025 18:37
@andrewmwells-amazon andrewmwells-amazon merged commit 50b870f into strata-org:typescript-frontend Dec 2, 2025
4 of 5 checks passed
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