From b97e4450a7ce377a1d50cac5342b7b1dd1a19add Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 24 Oct 2021 12:28:45 +0200 Subject: Fix symbol resolution on def expression --- src/bytecode/compiler.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/bytecode/compiler.h') diff --git a/src/bytecode/compiler.h b/src/bytecode/compiler.h index 47e7859..e2d5819 100755 --- a/src/bytecode/compiler.h +++ b/src/bytecode/compiler.h @@ -215,6 +215,9 @@ compile_define_op(Chunk *chunk, Visitor *vs, Token start) { return; } parse_tree(chunk, vs); + if (expr.type == TOKEN_SYMBOL) { + add_code(chunk, OP_GET_GLOBAL, expr.line, expr.column); + } if (peek_token(vs).type != TOKEN_RPAREN) { error_push((Error){ .type = ERR_TYPE_COMPILER, -- cgit v1.2.1