diff options
Diffstat (limited to 'src/parser.c')
-rw-r--r-- | src/parser.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser.c b/src/parser.c index fb18685..6ee273b 100644 --- a/src/parser.c +++ b/src/parser.c @@ -63,7 +63,7 @@ int parser_init(Parser *self, amal_compiler *compiler, ScopedAllocator *allocato self->error.index = 0; self->error.str = NULL; self->error_context = ERROR_CONTEXT_NONE; - return buffer_init(&self->ast_objects, self->allocator); + return scope_init(&self->scope, self->allocator); } /* @@ -116,7 +116,6 @@ static THROWABLE parser_parse_lhs(Parser *self, LhsExpr **result, bool *assignme throw_if_error(tokenizer_accept(&self->tokenizer, TOK_IDENTIFIER)); var_name = self->tokenizer.value.identifier; - amal_log_debug("var name: %.*s", (int)var_name.size, var_name.data); throw_if_error(scoped_allocator_alloc(self->allocator, sizeof(LhsExpr), (void**)result)); lhsexpr_init(*result, is_const, var_name); @@ -379,7 +378,7 @@ int parser_parse_rhs_start(Parser *self, Ast *rhs_expr) { } /* -BODY_SEMICOLON +BODY_SEMICOLON = ';' Note: Semicolon is not required for closures, structs and tables */ @@ -441,7 +440,7 @@ int parser_parse_buffer(Parser *self, BufferView code_buffer, BufferView buffer_ throw_if_error(tokenizer_init(&self->tokenizer, code_buffer, buffer_name)); result = setjmp(self->parse_env); if(result == 0) - try(parser_parse_body_loop(self, &self->ast_objects, TOK_END_OF_FILE)); + try(parser_parse_body_loop(self, &self->scope.ast_objects, TOK_END_OF_FILE)); else if(self->error.str != NULL) { switch(self->error_context) { case ERROR_CONTEXT_NONE: @@ -487,6 +486,7 @@ the path separator is a dot, otherwise the path separator is forward slash '/' int parser_queue_file(Parser *self, BufferView path) { /* TODO: Do not load same path twice or the compile will fail (and it can have recursive import) also for performance reasons */ /* TODO: Parse special path (to include library path with dots) */ + /* TODO: Path should be relative to the file that uses @import */ throw_if_error(amal_compiler_load_file(self->compiler, path)); return PARSER_OK; } |