stage1 完成07,08测试

This commit is contained in:
zzy
2026-07-06 10:44:01 +08:00
parent 5dadf6d6ee
commit 777b6b42d1
7 changed files with 93 additions and 8 deletions

View File

@@ -12,11 +12,19 @@ type Color = enum {
}
type Expr = enum {
Int: i32,
Add: struct { left: *Expr, right: *Expr },
val: i32,
add: struct { left: *Expr, right: *Expr },
tag: Tag,
type Tag = enum {
TagA,
TagB,
TagC,
}
}
fn main() i32 {
vm_printf("enum values: %d %d %d\n", Color.Red, Color.Green, Color.Blue);
vm_printf("enum values: %d %d %d\n", Expr.Tag.TagA, Expr.Tag.TagB, Expr.Tag.TagC);
ret 0;
}