diff options
author | ubq323 <ubq323@ubq323.website> | 2023-08-04 18:20:32 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-08-04 18:20:32 +0100 |
commit | 7c9790d7726e0bb3f44bec15eff7631080d45b03 (patch) | |
tree | 779e9c18a7482fd707f46a3b25008b6d8a05c393 | |
parent | d8b50976ce7fd4a44ba9172d69e8ae4ca6cab596 (diff) |
valty_str -> typename_str
-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))); \ |