ai: 生成代码准备重构前的一次提交
This commit is contained in:
1 parent
936a8d0e88
commit
032102f1d7
375 files changed
+4619
-7609
No files matched your search
+9
-1
@@ -1609,6 +1609,9 @@ fn parse_type_expr_core(self: *Parser): usize {
|
||||
t = peek(self);
|
||||
if t != null && kind_is_punct(t.kind, .RBracket) {
|
||||
expect_punct(self, .RBracket, "']' in array type");
|
||||
while skip_const_token(self) {
|
||||
// []const T
|
||||
}
|
||||
var slice_elem = parse_type_expr(self);
|
||||
ret new_node(self, .TypeSlice(.{ .elem_type = slice_elem }), t);
|
||||
}
|
||||
@@ -2490,7 +2493,12 @@ fn parse_match_expr(self: *Parser): usize {
|
||||
var pat = parse_pattern(self);
|
||||
if pat == 0 { break; }
|
||||
if !expect_punct(self, .RightFatArrow, "'=>' in match arm") { break; }
|
||||
var body = parse_block(self);
|
||||
var body: usize = 0;
|
||||
if at_punct(self, .LBrace) {
|
||||
body = parse_block(self);
|
||||
} else {
|
||||
body = parse_expr(self);
|
||||
}
|
||||
match Vec.push(&patterns, &pat as *u8) { .Ok => {}, .Err(e) => { ret 0; } }
|
||||
match Vec.push(&bodies, &body as *u8) { .Ok => {}, .Err(e) => { ret 0; } }
|
||||
if at_punct(self, .Comma) { advance(self); }
|
||||
|
||||
Reference in new issue
Block a user