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

implement names(REnvironment)

parent 99b987c4
No related branches found
No related tags found
No related merge requests found
/*
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -30,6 +30,7 @@ import com.oracle.truffle.r.nodes.builtin.*;
import com.oracle.truffle.r.runtime.*;
import com.oracle.truffle.r.runtime.data.*;
import com.oracle.truffle.r.runtime.data.model.*;
import com.oracle.truffle.r.runtime.env.REnvironment;
@RBuiltin(name = "names", kind = PRIMITIVE, parameterNames = {"x"})
public abstract class Names extends RBuiltinNode {
......@@ -47,6 +48,12 @@ public abstract class Names extends RBuiltinNode {
}
}
@Specialization
protected Object getNames(REnvironment env) {
controlVisibility();
return env.ls(true, null, false);
}
@Fallback
protected RNull getNames(@SuppressWarnings("unused") Object operand) {
controlVisibility();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment