diff options
author | Bad Diode <bd@badd10de.dev> | 2021-10-24 12:28:45 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-10-24 12:28:45 +0200 |
commit | b97e4450a7ce377a1d50cac5342b7b1dd1a19add (patch) | |
tree | 1bb1844c136df6f51280bc153fd28765f869dcf3 | |
parent | 634272f023a3123bc296690bc2dadd874b601ca9 (diff) | |
download | bdl-b97e4450a7ce377a1d50cac5342b7b1dd1a19add.tar.gz bdl-b97e4450a7ce377a1d50cac5342b7b1dd1a19add.zip |
Fix symbol resolution on def expression
-rwxr-xr-x | src/bytecode/compiler.h | 3 |
1 files changed, 3 insertions, 0 deletions
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) { | |||
215 | return; | 215 | return; |
216 | } | 216 | } |
217 | parse_tree(chunk, vs); | 217 | parse_tree(chunk, vs); |
218 | if (expr.type == TOKEN_SYMBOL) { | ||
219 | add_code(chunk, OP_GET_GLOBAL, expr.line, expr.column); | ||
220 | } | ||
218 | if (peek_token(vs).type != TOKEN_RPAREN) { | 221 | if (peek_token(vs).type != TOKEN_RPAREN) { |
219 | error_push((Error){ | 222 | error_push((Error){ |
220 | .type = ERR_TYPE_COMPILER, | 223 | .type = ERR_TYPE_COMPILER, |