callFunction method

dynamic callFunction(
  1. String functionName,
  2. List arguments
)

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.");
}