authorgravatar for rpkak@noreply.codeberg.orgrpkak <rpkak@noreply.codeberg.org> 2026-03-06 07:53:16+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-03-11 03:01:35+01:00
log77d76869029a3307531b67cdc2e82f63d84dd7e0
treecdc9f4596b91a9183594a54de0f08cd561d77efb
parenta388b88ed4811421ae0203dd467cc33383595c10

std.zig.putAstErrorsIntoBundle: support zon


1 files changed, 13 insertions(+), 3 deletions(-)

lib/std/zig.zig+13-3
...@@ -651,10 +651,20 @@ pub fn putAstErrorsIntoBundle(...@@ -651,10 +651,20 @@ pub fn putAstErrorsIntoBundle(
651 path: []const u8,651 path: []const u8,
652 wip_errors: *std.zig.ErrorBundle.Wip,652 wip_errors: *std.zig.ErrorBundle.Wip,
653) Allocator.Error!void {653) Allocator.Error!void {
654 var zir = try AstGen.generate(gpa, tree);654 switch (tree.mode) {
655 defer zir.deinit(gpa);655 .zig => {
656 var zir = try AstGen.generate(gpa, tree);
657 defer zir.deinit(gpa);
656658
657 try wip_errors.addZirErrorMessages(zir, tree, tree.source, path);659 try wip_errors.addZirErrorMessages(zir, tree, tree.source, path);
660 },
661 .zon => {
662 var zoir = try ZonGen.generate(gpa, tree, .{});
663 defer zoir.deinit(gpa);
664
665 try wip_errors.addZoirErrorMessages(zoir, tree, tree.source, path);
666 },
667 }
658}668}
659669
660pub fn resolveTargetQueryOrFatal(io: Io, target_query: std.Target.Query) std.Target {670pub fn resolveTargetQueryOrFatal(io: Io, target_query: std.Target.Query) std.Target {