summaryrefslogtreecommitdiff
path: root/val.c
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-26 14:44:19 +0100
committerubq323 <ubq323@ubq323.website>2024-06-26 14:44:19 +0100
commita8519434f058d0ab60bf7f90acc61997cb982cfa (patch)
treee1858d42805e61afbd5c6c0b9d2f3b47bc8411ee /val.c
parent20584e520dfd44393aa66350b442e8a23e46c5a3 (diff)
add cfunc type and rudimentary stdlib
Diffstat (limited to 'val.c')
-rw-r--r--val.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/val.c b/val.c
index ec200d3..7c8b25a 100644
--- a/val.c
+++ b/val.c
@@ -76,6 +76,9 @@ void print_val(Val v) {
break;
}
break;
+ case TY_CFUNC:
+ printf("[cfunc]");
+ break;
}
}
@@ -98,6 +101,7 @@ bool val_equal(Val a, Val b) {
case TY_NUM: return AS_NUM(a) == AS_NUM(b);
case TY_BOOL: return AS_BOOL(a) == AS_BOOL(b);
case TY_OBJ: return AS_OBJ(a) == AS_OBJ(b);
+ case TY_CFUNC: return AS_CFUNC(a) == AS_CFUNC(b);
default: return false;
}
}
@@ -114,6 +118,7 @@ const char *typename_str(Val v) {
case OTY_FUNC: return "Func";
}
break;
+ case TY_CFUNC: return "cfunc";
}
return "???";
}