summaryrefslogtreecommitdiff
path: root/val.c
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-20 21:45:57 +0100
committerubq323 <ubq323@ubq323.website>2024-06-20 21:45:57 +0100
commitfa8891ffe017ae890f0ef07915cf8b52acd7304a (patch)
tree7478faee1981c1c98ee5e88e6c56529f83a64817 /val.c
parent9a7d1b1d41f4b3bb3387e7bbe77105d0089803d0 (diff)
add true, false, nil keywords
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 40b7c5b..6f1dd9e 100644
--- a/val.c
+++ b/val.c
@@ -19,6 +19,11 @@ ObjString *objstring_copy(State *S, char *src, size_t len) {
return objstring_create(S, d, len, hash);
}
+ObjString *objstring_copy_cstr(State *S, char *str) {
+ size_t len = strlen(str);
+ return objstring_copy(S, str, len);
+}
+
ObjString *objstring_take(State *S, char *src, size_t len) {
uint32_t hash = hash_string(src, len);
ObjString *interned = ht_findstring(S, &S->strings, src, len, hash);