Fix error reporting for enforce new switch/for syntax

This commit is contained in:
gingerBill
2024-05-16 15:32:15 +01:00
parent a344bc4c0e
commit b2dc5cc812
2 changed files with 4 additions and 8 deletions

View File

@@ -266,7 +266,7 @@ gb_internal void terminal_reset_colours(void) {
}
gb_internal isize show_error_on_line(TokenPos const &pos, TokenPos end, char const *prefix=nullptr) {
gb_internal isize show_error_on_line(TokenPos const &pos, TokenPos end) {
get_error_value()->end = end;
if (!show_error_line()) {
return -1;
@@ -289,17 +289,13 @@ gb_internal isize show_error_on_line(TokenPos const &pos, TokenPos end, char con
MAX_LINE_LENGTH_PADDED = MAX_LINE_LENGTH-MAX_TAB_WIDTH-ELLIPSIS_PADDING,
};
if (prefix) {
error_out("\t%s\n\n", prefix);
}
i32 error_length = gb_max(end.offset - pos.offset, 1);
error_out("\t");
terminal_set_colours(TerminalStyle_Bold, TerminalColour_White);
i32 error_length = gb_max(end.offset - pos.offset, 1);
isize squiggle_extra = 0;
if (line_len > MAX_LINE_LENGTH_PADDED) {