From 517e9fe048844533d927c4e3b6d021f82ccea984 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Wed, 26 Jun 2024 14:48:27 +0100 Subject: remove OP_PUTS and OP_PRINT, use say and write functions instead --- com.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'com.c') diff --git a/com.c b/com.c index fcb4fdf..0ae79f6 100644 --- a/com.c +++ b/com.c @@ -39,8 +39,6 @@ static int stack_effect_of(Op opcode) { case OP_TRUE: case OP_FALSE: return 1; - case OP_PUTS: - case OP_PRINT: case OP_SKIP: case OP_REDO: case OP_SETGLOBAL: @@ -111,7 +109,7 @@ static size_t compile_constant(Compiler *C, Val v) { static void compile_call_instr(Compiler *C, uint8_t len) { compile_opcode(C, OP_CALL); compile_byte(C, len); - C->stack_cur -= len; + C->stack_cur -= len - 1; } static void compile_endscope_instr(Compiler *C, uint8_t nlocals) { @@ -337,8 +335,6 @@ typedef struct { } BuiltinForm; static BuiltinForm builtin_forms[] = { - { "puts", 1, false, single_form, OP_PUTS }, - { "print", 1, false, single_form, OP_PRINT }, { "set", 2, false, set_form, 0 }, { "do", 1, true, do_form, 0 }, { "if", 3, false, if_form, 0 }, -- cgit v1.2.3