stage3 ai编写新语法语义 同时提供fflush

This commit is contained in:
zzy committed 2026-11-05 09:48:43 +08:00
1 parent bb8761d392
commit 126b979f72
170 files changed
+10729 -3175

No files matched your search

+13 -2
View File
@@ -73,6 +73,7 @@ fn clone_ref(b: *Bld.HirNodeContainer, s: *CloneState, r: Ref): Ref {
},
.ParamDecl(x) => { k = .ParamDecl(.{ .is_comptime = x.is_comptime, .by_ref = x.by_ref, .name = x.name, .ty = clone_ref(b, s, x.ty) }); },
.TypeDecl(x) => { k = .TypeDecl(.{ .name = x.name, .ty = clone_ref(b, s, x.ty) }); },
.AssocDecl(x) => { k = .AssocDecl(.{ .name = x.name }); },
.FieldDecl(x) => { k = .FieldDecl(.{ .name = x.name, .ty = clone_ref(b, s, x.ty) }); },
.VarDecl(x) => { k = .VarDecl(.{ .is_comptime = x.is_comptime, .name = x.name, .ty = clone_ref(b, s, x.ty), .init = clone_ref(b, s, x.init) }); },
.ConstDecl(x) => { k = .ConstDecl(.{ .is_comptime = x.is_comptime, .name = x.name, .ty = clone_ref(b, s, x.ty), .init = clone_ref(b, s, x.init) }); },
@@ -84,7 +85,9 @@ fn clone_ref(b: *Bld.HirNodeContainer, s: *CloneState, r: Ref): Ref {
.Loop(x) => { k = .Loop(.{ .label = clone_ref(b, s, x.label), .body = clone_ref(b, s, x.body), .ret_ty = clone_ref(b, s, x.ret_ty) }); },
.Iter(x) => {
k = .Iter(.{ .label = clone_ref(b, s, x.label), .inputs = clone_refs(b, s, x.inputs),
.captures = clone_refs(b, s, x.captures), .body = clone_ref(b, s, x.body),
.captures = clone_refs(b, s, x.captures),
.pattern_type = clone_ref(b, s, x.pattern_type),
.body = clone_ref(b, s, x.body),
.else_body = clone_ref(b, s, x.else_body) });
},
.Break(x) => { k = .Break(.{ .label = clone_ref(b, s, x.label), .value = clone_ref(b, s, x.value) }); },
@@ -106,9 +109,17 @@ fn clone_ref(b: *Bld.HirNodeContainer, s: *CloneState, r: Ref): Ref {
.PatTuple(xs) => { k = .PatTuple(clone_refs(b, s, xs)); },
.PatField(x) => { k = .PatField(.{ .name = x.name, .sub = clone_ref(b, s, x.sub) }); },
.AggType(x) => {
k = .AggType(.{ .kind = x.kind, .fields = clone_refs(b, s, x.fields),
k = .AggType(.{ .kind = x.kind, .conforms = clone_refs(b, s, x.conforms),
.fields = clone_refs(b, s, x.fields),
.decls = clone_refs(b, s, x.decls), .injected = clone_refs(b, s, x.injected) });
},
.ShapeApply(x) => {
k = .ShapeApply(.{ .base = clone_ref(b, s, x.base), .binds = clone_refs(b, s, x.binds) });
},
.ShapeUse(x) => {
k = .ShapeUse(.{ .adapter = x.adapter, .shapes = clone_refs(b, s, x.shapes) });
},
.AssocBind(x) => { k = .AssocBind(.{ .name = x.name, .ty = clone_ref(b, s, x.ty) }); },
.ArrayType(x) => { k = .ArrayType(.{ .len = clone_ref(b, s, x.len), .elem = clone_ref(b, s, x.elem) }); },
.SliceType(x) => { k = .SliceType(clone_ref(b, s, x)); },
.PtrType(x) => { k = .PtrType(clone_ref(b, s, x)); },