forked from ground/ground
Extlibs can call extlib functions i hope
This commit is contained in:
@@ -193,6 +193,14 @@ GroundValue groundRunFunction(GroundFunction* function, size_t argc, ...) {
|
||||
// Seems to crash some functions
|
||||
// GroundScope callScope = copyGroundScope(&function->closure);
|
||||
|
||||
if (function->isNative) {
|
||||
List argsList = createList();
|
||||
for (size_t i = 0; i < argc; i++) {
|
||||
appendToList(&argsList, va_arg(args, GroundValue));
|
||||
}
|
||||
return function->nativeFn(NULL, argsList);
|
||||
}
|
||||
|
||||
GroundScope callScope = {
|
||||
.labels = malloc(sizeof(GroundLabel*)),
|
||||
.variables = malloc(sizeof(GroundVariable*)),
|
||||
|
||||
Reference in New Issue
Block a user