stage2: fix compile error rendering for hard tabs

render them as 1 space instead. This fixes the column caret.
This commit is contained in:
Andrew Kelley
2021-05-20 15:20:27 -07:00
parent 34d0542a53
commit 3845c264a6

View File

@@ -354,7 +354,10 @@ pub const AllErrors = struct {
try stderr.print(" {s}\n", .{src.msg});
ttyconf.setColor(stderr, .Reset);
if (src.source_line) |line| {
try stderr.writeAll(line);
for (line) |b| switch (b) {
'\t' => try stderr.writeByte(' '),
else => try stderr.writeByte(b),
};
try stderr.writeByte('\n');
try stderr.writeByteNTimes(' ', src.column);
ttyconf.setColor(stderr, .Green);