diff options
author | ubq323 <ubq323@ubq323.website> | 2024-06-26 14:44:19 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-06-26 14:44:19 +0100 |
commit | a8519434f058d0ab60bf7f90acc61997cb982cfa (patch) | |
tree | e1858d42805e61afbd5c6c0b9d2f3b47bc8411ee /val.c | |
parent | 20584e520dfd44393aa66350b442e8a23e46c5a3 (diff) |
add cfunc type and rudimentary stdlib
Diffstat (limited to 'val.c')
-rw-r--r-- | val.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 "???"; } |