From fa8891ffe017ae890f0ef07915cf8b52acd7304a Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 20 Jun 2024 21:45:57 +0100 Subject: add true, false, nil keywords --- val.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'val.c') 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); -- cgit v1.2.3