Minimize TokenPos size by using i32 for line/column/offset and file_id instead of String

To make `i32` safe, the parser limits the file size of odin files to a maximum of 2GiB (which will be good enough for the vast vast majority of cases)
This commit is contained in:
gingerBill
2021-03-04 16:45:30 +00:00
parent 17eb0ce525
commit 15dbc99cb9
11 changed files with 179 additions and 127 deletions

View File

@@ -1845,7 +1845,7 @@ void print_show_unused(Checker *c) {
}
if (build_context.show_unused_with_location) {
TokenPos pos = e->token.pos;
print_usage_line(2, "%.*s(%td:%td) %.*s", LIT(pos.file), pos.line, pos.column, LIT(e->token.string));
print_usage_line(2, "%s %.*s", token_pos_to_string(pos), LIT(e->token.string));
} else {
print_usage_line(2, "%.*s", LIT(e->token.string));
}