pub const CompileError = extern struct msg: NullTerminatedStringtoken: Ast.OptionalTokenIndexnode_or_offset: u32If token == .none, this is an Ast.Node.Index. Otherwise, this is a byte offset into token.
first_note: u32Ignored if note_count == 0.
note_count: u32pub fn getNotes(err: CompileError, zoir: Zoir) []const Note236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263pub const CompileError = extern struct {
msg: NullTerminatedString,
token: Ast.OptionalTokenIndex,
/// If `token == .none`, this is an `Ast.Node.Index`.
/// Otherwise, this is a byte offset into `token`.
node_or_offset: u32,
/// Ignored if `note_count == 0`.
first_note: u32,
note_count: u32,
pub fn getNotes(err: CompileError, zoir: Zoir) []const Note {
return zoir.error_notes[err.first_note..][0..err.note_count];
}
pub const Note = extern struct {
msg: NullTerminatedString,
token: Ast.OptionalTokenIndex,
/// If `token == .none`, this is an `Ast.Node.Index`.
/// Otherwise, this is a byte offset into `token`.
node_or_offset: u32,
};
comptime {
assert(std.meta.hasUniqueRepresentation(CompileError));
assert(std.meta.hasUniqueRepresentation(Note));
}
}