org.snapscript.tree.SuspendStatement 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;
import org.snapscript.core.Execution;
import org.snapscript.core.result.Result;
import org.snapscript.core.scope.Scope;
import org.snapscript.core.yield.Resume;
import org.snapscript.core.yield.Yield;
public abstract class SuspendStatement extends Execution implements Resume {
protected Result suspend(Scope scope, Result result, Resume child, T value) throws Exception {
Resume parent = suspend(result, child, value);
Yield yield = result.getValue();
Object object = yield.getValue();
return Result.getYield(object, scope, parent);
}
}