stage1 完成ast 定义sema

This commit is contained in:
zzy
2026-08-03 12:39:28 +08:00
parent a4ec5656d2
commit 74d7376039
19 changed files with 3857 additions and 137 deletions

View File

@@ -118,7 +118,7 @@ fn test_shape_match() i32 {
.Circle[r] => {
if r != 10 { ret 1; }
},
.Rect[.x = w, .y = h] => {
.Rect[p] => {
ret 2;
}
}
@@ -127,9 +127,9 @@ fn test_shape_match() i32 {
s = Shape { .Rect = Point { .x = 3, .y = 4 } };
match s {
.Circle[r] => { ret 3; },
.Rect[.x = w, .y = h] => {
if w != 3 { ret 4; }
if h != 4 { ret 5; }
.Rect[p] => {
if p.x != 3 { ret 4; }
if p.y != 4 { ret 5; }
}
}