zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 77d76869029a3307531b67cdc2e82f63d84dd7e0 (tree)
parent a388b88ed4811421ae0203dd467cc33383595c10
Author: rpkak <rpkak@noreply.codeberg.org>
Date:   Fri,  6 Mar 2026 07:53:16 +0100

std.zig.putAstErrorsIntoBundle: support zon

Diffstat:
Mlib/std/zig.zig | 16+++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/lib/std/zig.zig b/lib/std/zig.zig @@ -651,10 +651,20 @@ pub fn putAstErrorsIntoBundle( path: []const u8, wip_errors: *std.zig.ErrorBundle.Wip, ) Allocator.Error!void { - var zir = try AstGen.generate(gpa, tree); - defer zir.deinit(gpa); + switch (tree.mode) { + .zig => { + var zir = try AstGen.generate(gpa, tree); + defer zir.deinit(gpa); - try wip_errors.addZirErrorMessages(zir, tree, tree.source, path); + try wip_errors.addZirErrorMessages(zir, tree, tree.source, path); + }, + .zon => { + var zoir = try ZonGen.generate(gpa, tree, .{}); + defer zoir.deinit(gpa); + + try wip_errors.addZoirErrorMessages(zoir, tree, tree.source, path); + }, + } } pub fn resolveTargetQueryOrFatal(io: Io, target_query: std.Target.Query) std.Target {