Skip to content
Snippets Groups Projects
Commit fe6ff4eb authored by Florian Angerer's avatar Florian Angerer
Browse files

Implemented KEYS and KEY_INFO messages for REnvironemnt.

parent 2374f615
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,34 @@ public class REnvironmentMR {
}
}
@Resolve(message = "KEYS")
public abstract static class REnvironmentKeysNode extends Node {
protected Object access(REnvironment receiver) {
return receiver.ls(true, null, true);
}
}
@Resolve(message = "KEY_INFO")
public abstract static class REnvironmentKeyInfoNode extends Node {
private static final int READABLE = 1 << 1;
private static final int WRITABLE = 1 << 2;
protected Object access(@SuppressWarnings("unused") VirtualFrame frame, REnvironment receiver, String identifier) {
Object val = receiver.get(identifier);
if (val == null) {
return 0;
}
int info = READABLE;
if (!receiver.isLocked() && !receiver.bindingIsLocked(identifier)) {
info += WRITABLE;
}
return info;
}
}
@CanResolve
public abstract static class REnvironmentCheck extends Node {
......
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