org.snapscript.tree.closure.ClosureBody Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
package org.snapscript.tree.closure;
import org.snapscript.core.function.Function;
import org.snapscript.core.function.FunctionBody;
import org.snapscript.core.function.Invocation;
import org.snapscript.core.function.InvocationBuilder;
import org.snapscript.core.scope.Scope;
public class ClosureBody extends FunctionBody {
public ClosureBody(InvocationBuilder builder, InvocationBuilder other, Function function) {
super(builder, other, function);
}
@Override
public Function create(Scope scope) throws Exception {
Invocation invocation = new ClosureInvocation(actual, scope);
Function closure = new ClosureFunction(function, invocation);
return closure;
}
}