summaryrefslogtreecommitdiff
path: root/val.h
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-20 17:23:01 +0100
committerubq323 <ubq323@ubq323.website>2024-06-20 17:23:01 +0100
commitb8d0ee2e105727021f9466790ec07ecbfee8dff6 (patch)
treefe151cdbd4e0ca61a491f2f2fd01afc6448bc124 /val.h
parent60b3369ab24f9bd2a4a6d638ab1b3013ebc29814 (diff)
string interning and print statement
Diffstat (limited to 'val.h')
-rw-r--r--val.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/val.h b/val.h
index d742c14..4c84fd9 100644
--- a/val.h
+++ b/val.h
@@ -71,6 +71,8 @@ ObjString *objstring_take(State *S, char *src, size_t len);
#define VAL_NIL ((Val){.ty=TY_NIL})
#define VAL_NUM(x) ((Val){.ty=TY_NUM, .as.d=(x) })
#define VAL_BOOL(x) ((Val){.ty=TY_BOOL, .as.b=(x) })
+#define VAL_TRUE VAL_BOOL(1)
+#define VAL_FALSE VAL_BOOL(0)
#define VAL_OBJ(x) ((Val){.ty=TY_OBJ, .as.o=(Obj*)(x) })
static inline bool is_obj_ty(Val v, ObjTy t) {