Colorize build/resolve errors and add a ^

This commit is contained in:
Jarred Sumner
2021-09-16 17:37:22 -07:00
parent 03983ac24e
commit 9511bf94d5
7 changed files with 210 additions and 127 deletions

View File

@@ -834,9 +834,17 @@ pub const VirtualMachine = struct {
if (log.warnings > 0) {
var writer = Output.errorWriter();
for (log.msgs.items) |msg| {
if (msg.kind == .warn) {
msg.writeFormat(writer) catch {};
if (Output.enable_ansi_colors) {
for (log.msgs.items) |msg| {
if (msg.kind == .warn) {
msg.writeFormat(writer, true) catch {};
}
}
} else {
for (log.msgs.items) |msg| {
if (msg.kind == .warn) {
msg.writeFormat(writer, false) catch {};
}
}
}
}