authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-02-09 07:33:48-08:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2025-02-10 01:37:04-08:00
log00316bfbf0918d8e7893d03909211ba58ea2517f
treef210dc7e01a0a9bbe6ecbbbea3070c95a54d3261
parent6fa7d5d4ad02f9694bfabf0ef42f65236c02d1ef

resinator: Fix some error message integration

Fixup for some of the changes in https://github.com/ziglang/zig/pull/22522

1 files changed, 4 insertions(+), 4 deletions(-)

lib/compiler/resinator/main.zig+4-4
...@@ -183,17 +183,17 @@ pub fn main() !void {...@@ -183,17 +183,17 @@ pub fn main() !void {
183 var mapping_results = parseAndRemoveLineCommands(allocator, full_input, full_input, .{ .initial_filename = options.input_filename }) catch |err| switch (err) {183 var mapping_results = parseAndRemoveLineCommands(allocator, full_input, full_input, .{ .initial_filename = options.input_filename }) catch |err| switch (err) {
184 error.InvalidLineCommand => {184 error.InvalidLineCommand => {
185 // TODO: Maybe output the invalid line command185 // TODO: Maybe output the invalid line command
186 try renderErrorMessage(stderr.writer(), stderr_config, .err, "invalid line command in the preprocessed source", .{});186 try error_handler.emitMessage(allocator, .err, "invalid line command in the preprocessed source", .{});
187 if (options.preprocess == .no) {187 if (options.preprocess == .no) {
188 try renderErrorMessage(stderr.writer(), stderr_config, .note, "line commands must be of the format: #line <num> \"<path>\"", .{});188 try error_handler.emitMessage(allocator, .note, "line commands must be of the format: #line <num> \"<path>\"", .{});
189 } else {189 } else {
190 try renderErrorMessage(stderr.writer(), stderr_config, .note, "this is likely to be a bug, please report it", .{});190 try error_handler.emitMessage(allocator, .note, "this is likely to be a bug, please report it", .{});
191 }191 }
192 std.process.exit(1);192 std.process.exit(1);
193 },193 },
194 error.LineNumberOverflow => {194 error.LineNumberOverflow => {
195 // TODO: Better error message195 // TODO: Better error message
196 try renderErrorMessage(stderr.writer(), stderr_config, .err, "line number count exceeded maximum of {}", .{std.math.maxInt(usize)});196 try error_handler.emitMessage(allocator, .err, "line number count exceeded maximum of {}", .{std.math.maxInt(usize)});
197 std.process.exit(1);197 std.process.exit(1);
198 },198 },
199 error.OutOfMemory => |e| return e,199 error.OutOfMemory => |e| return e,