From c3fe9367986520b08a36bf693e6c74eb309377c5 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sat, 23 Oct 2021 16:00:11 +0200 Subject: Cleanup macros for arithmetic ops --- src/bytecode/compiler.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'src/bytecode/compiler.h') diff --git a/src/bytecode/compiler.h b/src/bytecode/compiler.h index e48a173..fd5cdbc 100755 --- a/src/bytecode/compiler.h +++ b/src/bytecode/compiler.h @@ -128,11 +128,11 @@ parse_tree(Chunk *chunk, Visitor *vs) { return ; } break; case TOKEN_TRUE: { - // return obj_true; + emit_constant(chunk, tok, TRUE_VAL); return; } break; case TOKEN_FALSE: { - // return obj_false; + emit_constant(chunk, tok, FALSE_VAL); return; } break; case TOKEN_RPAREN: { @@ -158,16 +158,6 @@ parse_tree(Chunk *chunk, Visitor *vs) { } break; case TOKEN_LPAREN: { parse_list(chunk, vs, tok); - // Object *obj = parse_list(vs); - // if (obj == obj_err) { - // error_push((Error){ - // .type = ERR_TYPE_COMPILER, - // .value = ERR_UNBALANCED_PAREN, - // .line = tok.line, - // .col = tok.column, - // }); - // } - // return obj; return; } break; case TOKEN_STRING: { @@ -184,7 +174,7 @@ parse_tree(Chunk *chunk, Visitor *vs) { return; } break; case TOKEN_NIL: { - // return obj_nil; + emit_constant(chunk, tok, NIL_VAL); return; } break; default: { -- cgit v1.2.1