diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-03-09 14:14:09 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | a52fdf470aa2c164108aeccc2c83bad62208913c (patch) | |
tree | 9b4dea7aa0e53976958ac908d345f6f1914602d1 /src/parser.c | |
parent | 255aa20f6d68a71c9eedd47998480a8b14a3be36 (diff) |
Start on resolving ast. Add recursive declaration check
Diffstat (limited to 'src/parser.c')
-rw-r--r-- | src/parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser.c b/src/parser.c index fcc29be..b91e15a 100644 --- a/src/parser.c +++ b/src/parser.c @@ -231,7 +231,7 @@ static THROWABLE parser_parse_function_call_or_variable(Parser *self, Ast *expr) if(!match) { Variable *variable; throw_if_error(scoped_allocator_alloc(self->allocator, sizeof(Variable), (void**)&variable)); - variable->name = identifier; + variable_init(variable, identifier); expr->type = AST_VARIABLE; expr->value.variable = variable; return PARSER_OK; @@ -471,7 +471,7 @@ int parser_parse_buffer(Parser *self, BufferView code_buffer, BufferView buffer_ tokenizer_print_error_object(&self->tokenizer, &self->error); break; case ERROR_CONTEXT_RHS_START: - tokenizer_print_error(&self->tokenizer, "Expected string, variable, closure, function call or import"); + tokenizer_print_error(&self->tokenizer, self->tokenizer.prev_index, "Expected string, variable, closure, function call or import"); break; default: assert(bool_false && "Error context handling not implemented"); |