Skip to content
Snippets Groups Projects
Commit 32305f34 authored by Lukas Stadler's avatar Lukas Stadler
Browse files

BlockNode needs to reset visibility

parent bdded0e4
Branches
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
package com.oracle.truffle.r.nodes.control;
import com.oracle.truffle.api.CompilerDirectives.*;
import com.oracle.truffle.api.frame.*;
import com.oracle.truffle.api.source.*;
import com.oracle.truffle.r.runtime.*;
import com.oracle.truffle.r.runtime.env.*;
......@@ -32,7 +33,7 @@ import com.oracle.truffle.r.runtime.nodes.*;
* A {@link BlockNode} represents a sequence of statements such as the body of a {@code while} loop.
*
*/
public class BlockNode extends SequenceNode implements RSyntaxNode {
public class BlockNode extends SequenceNode implements RSyntaxNode, VisibilityController {
public static final RNode[] EMPTY_BLOCK = new RNode[0];
public BlockNode(SourceSection src, RNode[] sequence) {
......@@ -47,6 +48,12 @@ public class BlockNode extends SequenceNode implements RSyntaxNode {
this(src, convert(node));
}
@Override
public Object execute(VirtualFrame frame) {
controlVisibility();
return super.execute(frame);
}
/**
* Ensures that {@code node} is a {@link BlockNode}.
*/
......@@ -89,7 +96,7 @@ public class BlockNode extends SequenceNode implements RSyntaxNode {
* it is represented as a LANGSXP with symbol "{" and a NULL cdr, representing the empty
* sequence. This is an unpleasant special case in FastR that we can only detect by
* re-examining the original source.
*
*
* A sequence of length 1, i.e. a single statement, is represented as itself, e.g. a SYMSXP
* for "x" or a LANGSXP for a function call. Otherwise, the representation is a LISTSXP
* pairlist, where the car is the statement and the cdr is either NILSXP or a LISTSXP for
......
......@@ -100,12 +100,13 @@ public final class FastRSession implements RSession {
}
}
private static TestConsoleHandler consoleHandler;
private static FastRSession singleton;
private EvalThread evalThread;
private final TestConsoleHandler consoleHandler;
private final TruffleVM main;
private EvalThread evalThread;
public static FastRSession create() {
if (singleton == null) {
singleton = new FastRSession();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment