Commit 8347ba0
feat: support inline variant type syntax in parser
Adds `type X = A | B | C;` syntax as sugar for `enum X { A, B, C }`.
Requires at least 2 variants separated by PIPE to avoid conflicting
with the existing type alias rule. Reuses the existing `variant_decl`
grammar and `TyEnum` AST node — no AST changes needed.
Fixes: test_types.as in airborne-submarine-squadron
Also fixes: stdlib/prelude.as, examples/traits.as variant definitions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3a31737 commit 8347ba0
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
215 | 222 | | |
216 | 223 | | |
217 | 224 | | |
| |||
0 commit comments