Add simple evaluation
This commit is contained in:
10
src/memory.c
10
src/memory.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user