vig/src/errors.zig

15 lines
457 B
Zig
Raw Normal View History

2019-06-06 01:06:12 +00:00
const std = @import("std");
pub fn report(line: usize, where: []const u8, message: []const u8) void {
2020-04-10 19:48:10 +00:00
std.debug.warn("[line {}] Error{}: {}", .{ line, where, message });
2019-06-06 01:06:12 +00:00
}
pub fn reportN(line: usize, message: []const u8) void {
report(line, "", message);
}
2020-07-23 19:38:26 +00:00
pub fn reportFmt(line: usize, comptime fmt: []const u8, args: anytype) void {
2020-04-10 19:48:10 +00:00
std.debug.warn("[line {}] Error", .{line});
2019-06-06 01:06:12 +00:00
std.debug.warn(fmt, args);
2020-04-10 19:48:10 +00:00
std.debug.warn("\n", .{});
2019-06-06 01:06:12 +00:00
}