diff options
-rw-r--r-- | dis.c | 2 | ||||
-rw-r--r-- | val.c | 2 | ||||
-rw-r--r-- | val.h | 2 | ||||
-rw-r--r-- | vm.c | 2 |
4 files changed, 4 insertions, 4 deletions
@@ -18,7 +18,7 @@ void disasm_chunk(Chunk *ch) { uint8_t ix = ch->b[ip++]; printf("loadk #%d\t; ",ix); Val k = ch->c[ix]; - printf("%-4s : ",valty_str(k)); + printf("%-4s : ",typename_str(k)); println_val(k); break; SIMPLE_INSTR(OP_PRINT, "print") @@ -42,7 +42,7 @@ void println_val(Val v) { } -const char *valty_str(Val v) { +const char *typename_str(Val v) { switch(v.ty) { case TY_NIL: return "nil"; case TY_NUM: return "num"; @@ -24,7 +24,7 @@ typedef struct _val { } Val; void print_val(Val v); void println_val(Val v); -const char *valty_str(Val v); +const char *typename_str(Val v); typedef enum { @@ -112,7 +112,7 @@ void runvm(Chunk *ch) { Val a = POP(); \ if (!IS_NUM(a) || !IS_NUM(b)) { \ printf("can't do arithmetic on %s and %s\n", \ - valty_str(a), valty_str(b)); \ + typename_str(a), typename_str(b)); \ goto done; \ } \ PUSH(VAL_NUM(AS_NUM(a) OP AS_NUM(b))); \ |