feat: switch/case statement
- Add syntax - Desugars to if-else chain in HIR lowering (both compilers) - No new HIR/C backend nodes needed — reuses hIf/hBinary/hBlock - Supports integer, char, and enum tag dispatch - Case body can be single statement (no braces required)
This commit is contained in:
@@ -139,6 +139,9 @@ const tkAwait: int = 103;
|
||||
const tkSpawn: int = 104;
|
||||
const tkDiscard: int = 105;
|
||||
const tkDefer: int = 106;
|
||||
const tkSwitch: int = 107;
|
||||
const tkCase: int = 108;
|
||||
const tkDefault: int = 109;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Token struct
|
||||
|
||||
Reference in New Issue
Block a user