Some more allocation cleanup in checker and lexer.

This commit is contained in:
2025-09-30 07:45:03 +02:00
parent a4b5a7677b
commit d8107434df
2 changed files with 6 additions and 69 deletions

View File

@@ -569,7 +569,6 @@ scan_next_token :: (lexer : *Lexer) -> *Token {
s : string = .{ count = 1, data = *c };
record_error(lexer, tprint("Invalid token: %", s));
return null;
// return error_token(lexer, tprint("Invalid token: %", s));
}
lex :: (ctx : *Compiler_Context, allocator := temp) {
@@ -585,7 +584,7 @@ lex :: (ctx : *Compiler_Context, allocator := temp) {
lexer : Lexer;
lexer.ctx = ctx;
array_reserve(*lexer.ctx.tokens, 1024);
array_reserve(*lexer.ctx.tokens, 128);
init_lexer_from_string(*lexer, ctx.file.source);
lexer.path = ctx.file.path;