summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dis.c2
-rw-r--r--val.c2
-rw-r--r--val.h2
-rw-r--r--vm.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/dis.c b/dis.c
index b96f07c..0eb2720 100644
--- a/dis.c
+++ b/dis.c
@@ -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")
diff --git a/val.c b/val.c
index 41d3a06..cd76595 100644
--- a/val.c
+++ b/val.c
@@ -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";
diff --git a/val.h b/val.h
index 1ab716b..6e4cc18 100644
--- a/val.h
+++ b/val.h
@@ -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 {
diff --git a/vm.c b/vm.c
index f7887d3..c420774 100644
--- a/vm.c
+++ b/vm.c
@@ -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))); \