stage1 完成ast 定义sema
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user