From 15dbc99cb975675b89f5efe714d5209bce972014 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 4 Mar 2021 16:45:30 +0000 Subject: 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) --- src/parser.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/parser.hpp') 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; -- cgit v1.2.3