Add simple evaluation

This commit is contained in:
2022-10-28 22:29:37 -04:00
parent ed173bd17a
commit 26a0d17074
6 changed files with 75 additions and 17 deletions

View File

@@ -48,6 +48,15 @@ struct nl_object *nl_error_create(const char *error)
return obj;
}
struct nl_object *nl_builtin_create(nl_builtin builtin)
{
struct nl_object* obj = nl_object_alloc();
obj->type = NL_TYPE_BUILTIN;
obj->builtin = builtin;
return obj;
}
static struct nl_object* nl_object_alloc() {
return malloc(sizeof(struct nl_object));
}
@@ -77,6 +86,7 @@ void nl_object_delete(struct nl_object *obj) {
obj->error = NULL;
break;
case NL_TYPE_INT:
case NL_TYPE_BUILTIN:
case NL_TYPE_COUNT:
break;
}