diff options
| author | gingerBill <bill@gingerbill.org> | 2021-03-04 16:45:30 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-03-04 16:45:30 +0000 |
| commit | 15dbc99cb975675b89f5efe714d5209bce972014 (patch) | |
| tree | f4afc5894fa21b2e42609bf1555ee57a177f8a1f /src/parser.hpp | |
| parent | 17eb0ce525ffe94f13aabbc8d2245a9fda61aba0 (diff) | |
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)
Diffstat (limited to 'src/parser.hpp')
| -rw-r--r-- | src/parser.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parser.hpp b/src/parser.hpp index 6ce337352..eab230816 100644 --- a/src/parser.hpp +++ b/src/parser.hpp @@ -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; |