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