callFunction method
Implementation
dynamic callFunction(String functionName, List arguments) {
final function = _environment.getValue(functionName);
if (function is FunctionDeclaration) {
return callFunctionDeclaration(function, arguments);
} else if (function is Function) {
return function(arguments);
}
throw EvaluationError(
"Function '$functionName' not found or not callable.");
}