Skip to content
Snippets Groups Projects
Commit 2f85a296 authored by Zbynek Slajchrt's avatar Zbynek Slajchrt
Browse files

NonNANode supports RAbstractContainer. It uses the isComplete() method to...

NonNANode supports RAbstractContainer. It uses the isComplete() method to determine whether the input argument is or is not an NA.
parent 62cb7df8
Branches
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@ import com.oracle.truffle.r.runtime.RError;
import com.oracle.truffle.r.runtime.RRuntime;
import com.oracle.truffle.r.runtime.data.RComplex;
import com.oracle.truffle.r.runtime.data.RNull;
import com.oracle.truffle.r.runtime.data.model.RAbstractContainer;
import com.oracle.truffle.r.runtime.nodes.RBaseNode;
public abstract class NonNANode extends CastNode {
......@@ -147,4 +148,18 @@ public abstract class NonNANode extends CastNode {
return x;
}
protected boolean isComplete(RAbstractContainer x) {
return x.isComplete();
}
@Specialization(guards = "isComplete(x)")
protected Object onCompleteContainer(RAbstractContainer x) {
return x;
}
@Specialization(guards = "!isComplete(x)")
protected Object onIncompleteContainer(RAbstractContainer x) {
return handleNA(x);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment