diff options
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"); |