feature. See also
. The project being documented here (as the example) is the Zig library itself.
ZonGen.addErrorInner
fn addErrorInner(
zg: *ZonGen,
token: Ast.OptionalTokenIndex,
node_or_offset: u32,
comptime format: []const u8,
args: anytype,
notes: []const Zoir.CompileError.Note,
) Allocator.Error!void
File
Code
fn addErrorInner(
zg: *ZonGen,
token: Ast.OptionalTokenIndex,
node_or_offset: u32,
comptime format: []const u8,
args: anytype,
notes: []const Zoir.CompileError.Note,
) Allocator.Error!void {
const gpa = zg.gpa;
const first_note: u32 = @intCast(zg.error_notes.items.len);
try zg.error_notes.appendSlice(gpa, notes);
const message_idx: u32 = @intCast(zg.string_bytes.items.len);
try zg.string_bytes.print(gpa, format ++ "\x00", args);
try zg.compile_errors.append(gpa, .{
.msg = @fromBackingInt(@intCast(message_idx)),
.token = token,
.node_or_offset = node_or_offset,
.first_note = first_note,
.note_count = @intCast(notes.len),
});
}