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
+2 -1
View File
@@ -42,6 +42,7 @@ enum ParseFileError {
ParseFile_NotFound,
ParseFile_InvalidToken,
ParseFile_GeneralError,
ParseFile_FileTooLarge,
ParseFile_Count,
};
@@ -74,7 +75,7 @@ struct ImportedFile {
};
struct AstFile {
isize id;
i32 id;
AstPackage * pkg;
Scope * scope;