new built-in keysof and rewrote the json parser

This commit is contained in:
cozis
2022-12-06 22:43:13 +01:00
parent 7e3eb6364a
commit 380b8a8917
11 changed files with 521 additions and 219 deletions
+10
View File
@@ -88,6 +88,16 @@ const TypeObject *Object_GetType(const Object *obj)
return obj->type;
}
Object*
Object_KeysOf(Object *self,
Heap *heap,
Error *error)
{
if (self->type->keysof == NULL)
return Object_NewNone(heap, error);
return self->type->keysof(self, heap, error);
}
bool Object_IsTypeOf(Object *typ, Object *obj, Heap *heap, Error *error)
{
if (typ->type->istypeof == NULL)