Function format [src]

Prototype

pub fn format( self: *const @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype, ) !void

Parameters

self: *const @This()fmt: []const u8options: std.fmt.FormatOptions

Source

pub fn format( self: *const @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype, ) !void { _ = fmt; _ = options; var errors = self.iterateErrors(); while (errors.next()) |err| { const loc = err.getLocation(self); const msg = err.fmtMessage(self); try writer.print("{}:{}: error: {}\n", .{ loc.line + 1, loc.column + 1, msg }); var notes = err.iterateNotes(self); while (notes.next()) |note| { const note_loc = note.getLocation(self); const note_msg = note.fmtMessage(self); try writer.print("{}:{}: note: {s}\n", .{ note_loc.line + 1, note_loc.column + 1, note_msg, }); } } }