| ... | @@ -543,7 +543,10 @@ fn printIndicatorLine(source: []const u8, indicator_index: usize) void { | ... | @@ -543,7 +543,10 @@ fn printIndicatorLine(source: []const u8, indicator_index: usize) void { |
| 543 | while (i < indicator_index) : (i += 1) | 543 | while (i < indicator_index) : (i += 1) |
| 544 | print(" ", .{}); | 544 | print(" ", .{}); |
| 545 | } | 545 | } |
| 546 | print("^\n", .{}); | 546 | if (indicator_index >= source.len) |
| | 547 | print("^ (end of string)\n", .{}) |
| | 548 | else |
| | 549 | print("^ ('\\x{x:0>2}')\n", .{source[indicator_index]}); |
| 547 | } | 550 | } |
| 548 | | 551 | |
| 549 | fn printWithVisibleNewlines(source: []const u8) void { | 552 | fn printWithVisibleNewlines(source: []const u8) void { |