Skip to content
Snippets Groups Projects
Commit b8d8bd82 authored by Mick Jordan's avatar Mick Jordan
Browse files

add globalenv builtin, pretty print support for REnvironment

parent b57c6318
Branches
No related tags found
No related merge requests found
......@@ -88,6 +88,7 @@ public class BasePackage extends RPackage {
load(Exists.class);
load(Floor.class);
load(Get.class);
load(GlobalEnv.class);
load(Gregexpr.class);
load(GSub.class);
load(Ifelse.class);
......@@ -154,10 +155,11 @@ public class BasePackage extends RPackage {
load(Sprintf.class);
load(Sqrt.class);
load(Stop.class);
load(Strsplit.class);
load(Sub.class);
load(Substr.class);
load(Sum.class);
load(Strsplit.class);
// load(SysGetpid.class);
load(ToLower.class);
load(ToString.class);
load(ToUpper.class);
......
package com.oracle.truffle.r.nodes.builtin.base;
import com.oracle.truffle.api.dsl.*;
import com.oracle.truffle.r.nodes.builtin.*;
import com.oracle.truffle.r.runtime.*;
@RBuiltin({"globalenv"})
public abstract class GlobalEnv extends RBuiltinNode {
@Specialization
public Object globalenv() {
return RRuntime.GLOBAL_ENV;
}
}
......@@ -178,6 +178,11 @@ public abstract class PrettyPrinterNode extends RNode {
return ((RRootNode) ((DefaultCallTarget) operand.getTarget()).getRootNode()).getSourceCode();
}
@Specialization
public String prettyPrint(REnvironment operand, Object listElementName) {
return operand.toString();
}
private String printAttributes(VirtualFrame frame, RAbstractVector vector, Map<String, Object> attributes) {
StringBuilder builder = new StringBuilder();
for (Map.Entry<String, Object> attr : attributes.entrySet()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment