summaryrefslogtreecommitdiff
path: root/val.c
diff options
context:
space:
mode:
Diffstat (limited to 'val.c')
-rw-r--r--val.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/val.c b/val.c
index 43e47d3..ed375ac 100644
--- a/val.c
+++ b/val.c
@@ -184,3 +184,10 @@ const char *typename_str(Val v) {
}
return "???";
}
+
+int val_type(Val v) {
+ if (IS_OBJ(v))
+ return AS_OBJ(v)->oty;
+ else
+ return v.ty;
+}