diff options
Diffstat (limited to 'src/tokenizer.c')
-rw-r--r-- | src/tokenizer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tokenizer.c b/src/tokenizer.c index bce386d..7620fc0 100644 --- a/src/tokenizer.c +++ b/src/tokenizer.c @@ -2,7 +2,7 @@ #include "../include/std/mem.h" #include "../include/std/log.h" #include "../include/std/thread.h" -#include "../include/std/scoped_allocator.h" +#include "../include/std/arena_allocator.h" #include <assert.h> #include <limits.h> #include <stdio.h> @@ -25,7 +25,7 @@ static int tokenizer_get_end_of_line_from_index(Tokenizer *self, int index); /* Returns -1 if end of multiline comment was not found */ static int tokenizer_get_end_of_multiline_comment(Tokenizer *self, int index); -int tokenizer_init(Tokenizer *self, ScopedAllocator *allocator, BufferView code, BufferView code_name, const amal_compiler_options *compiler_options) { +int tokenizer_init(Tokenizer *self, ArenaAllocator *allocator, BufferView code, BufferView code_name, const amal_compiler_options *compiler_options) { assert(code.size <= INT_MAX); assert(compiler_options); /* Skip UTF-8 BOM */ @@ -415,6 +415,7 @@ static const char* binop_to_string(BinopType binop_type) { static BufferView tokenizer_expected_token_as_string(Token token) { const char *str; + str = ""; switch(token) { case TOK_NONE: str = "none"; @@ -737,7 +738,7 @@ TokenizerError tokenizer_create_error(Tokenizer *self, int index, const char *fm result.index = index; result.str = NULL; - ignore_result_int(scoped_allocator_alloc(self->allocator, bytes_copied + 1, (void**)&result.str)); + ignore_result_int(arena_allocator_alloc(self->allocator, bytes_copied + 1, (void**)&result.str)); if(result.str && bytes_copied > 0) am_memcpy(result.str, buffer, bytes_copied + 1); return result; |