Bug 573305: [R-Model] Fix linkage of function names of replacement
function calls
Change-Id: I068e7a18f30f76480f8a16d8169d82a80fb94c0b
diff --git a/r/org.eclipse.statet.r.core/src/org/eclipse/statet/internal/r/core/sourcemodel/SourceAnalyzer.java b/r/org.eclipse.statet.r.core/src/org/eclipse/statet/internal/r/core/sourcemodel/SourceAnalyzer.java
index c1e2eb5..65e4f37 100644
--- a/r/org.eclipse.statet.r.core/src/org/eclipse/statet/internal/r/core/sourcemodel/SourceAnalyzer.java
+++ b/r/org.eclipse.statet.r.core/src/org/eclipse/statet/internal/r/core/sourcemodel/SourceAnalyzer.java
@@ -401,7 +401,7 @@
private FCallAnalyzer fCallFallback;
private final FCallAnalyzer fCallNoAnalysis= new FCallAnalyzer() {
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
visitFCallArgs(node.getArgsChild(), inject0ArgValues);
SourceAnalyzer.this.returnValue= null;
@@ -508,8 +508,9 @@
this.fCallAnalyzers.put(RCoreFunctions.METHODS_FINDMETHOD_NAME,
new MethodsFindMethod(rdef));
- this.fCallAnalyzers.put(RCoreFunctions.METHODS_SLOT_NAME,
- new MethodsSlot(rdef));
+ analyzer= new MethodsSlot(rdef);
+ this.fCallAnalyzers.put(RCoreFunctions.METHODS_SLOT_NAME, analyzer);
+ this.fCallAnalyzers.put(RCoreFunctions.METHODS_SLOT_assign_NAME, analyzer);
for (final String name : rdef.getKnownFunctions()) {
if (!this.fCallAnalyzers.containsKey(name)) {
@@ -1120,15 +1121,18 @@
}
private void visit(final FCall node,
- final @Nullable RAstNode assignmentValueArg,
+ final @Nullable RAstNode replValueArg,
final ImList<RAstNode> inject0Args) throws InvocationTargetException {
// Resolve
final RAstNode ref= node.getRefChild();
final ElementAccess access= new ElementAccess.Default(node, ref);
access.flags= ElementAccess.A_CALL | ElementAccess.A_FUNC;
- final String name= resolveElementName(node.getRefChild(), access, true);
+ String name= resolveElementName(node.getRefChild(), access, true);
if (name != null) {
+ if (replValueArg != null) {
+ name+= "<-"; //$NON-NLS-1$
+ }
registerInEnvir(S_SEARCH, name, access);
}
@@ -1139,7 +1143,7 @@
if (specialist == null) {
specialist= this.fCallFallback;
}
- specialist.visit(node, assignmentValueArg, inject0Args);
+ specialist.visit(node, replValueArg, inject0Args);
}
@Override
@@ -1510,7 +1514,7 @@
protected interface FCallAnalyzer {
- void visit(FCall node, @Nullable RAstNode assignmentValueArg, ImList<RAstNode> inject0ArgValues) throws InvocationTargetException;
+ void visit(FCall node, @Nullable RAstNode replValueArg, ImList<RAstNode> inject0ArgValues) throws InvocationTargetException;
}
@@ -1527,9 +1531,9 @@
}
@Override
- public final void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public final void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode nameValue= args.getArgValueNode(this.argIdx_name);
if (nameValue != null && nameValue.getNodeType() == NodeType.STRING_CONST) {
@@ -1572,9 +1576,9 @@
}
@Override
- public final void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public final void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
ITER_ARGS: for (int i= 0; i < args.allocatedArgs.length; i++) {
final RAstNode argValue= args.getArgValueNode(i);
@@ -1644,9 +1648,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.returnValue= null;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode xNode= args.getArgValueNode(this.argIdx_x);
final RAstNode valueNode= args.getArgValueNode(this.argIdx_value);
@@ -1684,9 +1688,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
if (args.ellipsisArgs.length > 0) {
for (int i= 0; i < args.ellipsisArgs.length; i++) {
@@ -1743,9 +1747,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode xNode= args.getArgValueNode(this.argIdx_x);
if (xNode != null && xNode.getNodeType() == NodeType.STRING_CONST) {
@@ -1778,9 +1782,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
if (args.ellipsisArgs.length > 0) {
for (int i= 0; i < args.ellipsisArgs.length; i++) {
@@ -1821,9 +1825,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode nameNode= args.getArgValueNode(this.argIdx_fName);
if (nameNode != null && nameNode.getNodeType() == NodeType.STRING_CONST) {
@@ -1852,9 +1856,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode nameNode= args.getArgValueNode(this.argIdx_fName);
if (nameNode != null) {
@@ -1886,10 +1890,10 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode nameValue= args.getArgValueNode(this.argIdx_packageName);
if (nameValue != null
&& (nameValue.getNodeType() == NodeType.STRING_CONST
@@ -1946,7 +1950,7 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
visitFCallArgs(node.getArgsChild(), inject0ArgValues);
SourceAnalyzer.this.returnValue= SourceAnalyzer.this.globalEnvir;
@@ -1960,7 +1964,7 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
// final RAstNode envir= resolveEnvir(argValues, this.argsDef);
visitFCallArgs(node.getArgsChild(), inject0ArgValues);
@@ -1978,11 +1982,11 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
Object returnValue= null;
REQUEST: for (int i= 0; i < SourceAnalyzer.this.request.length; i++) {
if (SourceAnalyzer.this.request[i] == RETURN_STRING_ARRAY) {
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode[] array= new @NonNull RAstNode[args.ellipsisArgs.length];
for (int j= 0; j < array.length; j++) {
final FCall.Arg argNode= args.ellipsisArgs[j];
@@ -2028,9 +2032,9 @@
}
@Override
- public final void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public final void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode fNameNode= args.getArgValueNode(this.argIdx_fName);
if (fNameNode != null && fNameNode.getNodeType() == NodeType.STRING_CONST) {
@@ -2161,9 +2165,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode fNameNode= args.getArgValueNode(this.argIdx_fName);
if (fNameNode != null && fNameNode.getNodeType() == NodeType.STRING_CONST) {
@@ -2190,9 +2194,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
Object returnValue= null;
if (args.ellipsisArgs.length > 0) {
@@ -2241,9 +2245,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final ElementAccess access= new ElementAccess.Class(node);
access.flags= ElementAccess.A_WRITE;
@@ -2320,9 +2324,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode classNameValue= args.getArgValueNode(this.argIdx_className);
final RAstNode superClassNamesValue= args.getArgValueNode(this.argIdx_superClassNames);
@@ -2384,10 +2388,10 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
final SourceElementBuilder containerBuilder= (SourceAnalyzer.this.request == REPRESENTATION_REQUEST) ?
getCurrentSourceContainerBuilder(RElement.R_S4CLASS) : null;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
if (args.ellipsisArgs.length > 0) {
final RSourceElementByElementAccess.RClass rClass= (containerBuilder != null) ?
@@ -2451,10 +2455,10 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
final SourceElementBuilder containerBuilder= (SourceAnalyzer.this.request == PROTOTYPE_REQUEST) ?
getCurrentSourceContainerBuilder(RElement.R_S4CLASS) : null;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
if (args.ellipsisArgs.length > 0) {
// final RSourceElementByElementAccess.RClass classDef= (containerBuilder != null) ?
@@ -2515,9 +2519,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode classNameNode= args.getArgValueNode(this.argIdx_className);
final RAstNode cToExtendNameNode= args.getArgValueNode(this.argIdx_classToExtendName);
RClassExt rClassExt= null;
@@ -2590,9 +2594,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode classNameNode= args.getArgValueNode(this.argIdx_className);
if (classNameNode != null && classNameNode.getNodeType() == NodeType.STRING_CONST) {
@@ -2624,9 +2628,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode classNameNode= args.getArgValueNode(this.argIdx_className);
final RAstNode toClassNode= args.getArgValueNode(this.argIdx_toClass);
@@ -2665,9 +2669,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode classNameNode= args.getArgValueNode(this.argIdx_className);
if (classNameNode != null && classNameNode.getNodeType() == NodeType.STRING_CONST) {
@@ -2697,9 +2701,9 @@
}
@Override
- public final void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public final void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode classNameNode= args.getArgValueNode(this.argIdx_className);
if (classNameNode != null && classNameNode.getNodeType() == NodeType.STRING_CONST) {
@@ -2768,9 +2772,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode fNameValue= args.getArgValueNode(this.argIdx_fName);
final RAstNode fDefValue= args.getArgValueNode(this.argIdx_fDef);
@@ -2825,9 +2829,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode fNameArg= args.getArgValueNode(this.argIdx_fName);
if (fNameArg != null && fNameArg.getNodeType() == NodeType.STRING_CONST) {
@@ -2859,9 +2863,9 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode fNameArg= args.getArgValueNode(this.argIdx_fName);
if (fNameArg != null && fNameArg.getNodeType() == NodeType.STRING_CONST) {
@@ -2890,9 +2894,9 @@
}
@Override
- public final void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public final void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode fNameNode= args.getArgValueNode(this.argIdx_fName);
if (fNameNode != null && fNameNode.getNodeType() == NodeType.STRING_CONST) {
@@ -2955,15 +2959,15 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
- final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, assignmentValueArg, inject0ArgValues);
+ final FCallArgMatch args= RAsts.matchArgs(node.getArgsChild(), this.argsDef, replValueArg, inject0ArgValues);
final RAstNode objectArg= args.getArgValueNode(this.argIdx_object);
final RAstNode slotArg= args.getArgValueNode(this.argIdx_slotName);
if (objectArg != null && objectArg.getNodeType() == NodeType.SYMBOL) {
final ElementAccess access= new ElementAccess.Default(node);
- access.flags= (assignmentValueArg != null) ?
+ access.flags= (replValueArg != null) ?
(ElementAccess.A_WRITE | ElementAccess.A_SUB) :
(ElementAccess.A_READ | ElementAccess.A_SUB);
access.nameNode= objectArg;
@@ -2990,16 +2994,14 @@
}
@Override
- public void visit(final FCall node, final @Nullable RAstNode assignmentValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
+ public void visit(final FCall node, final @Nullable RAstNode replValueArg, final ImList<RAstNode> inject0ArgValues) throws InvocationTargetException {
SourceAnalyzer.this.request= NO_REQUESTS;
final FCall.Args args= node.getArgsChild();
- if (args.getChildCount() > 0 && assignmentValueArg != null) {
+ if (args.getChildCount() > 0 && replValueArg != null) {
final FCall.Arg firstArg= args.getChild(0);
- final RAstNode argName= firstArg.getNameChild();
final RAstNode argValue= firstArg.getValueChild();
- if (argValue != null
- && (argName == null || isTextEqualTo(argName, "x")) ) { //$NON-NLS-1$
+ if (argValue != null) { //$NON-NLS-1$
final ElementAccess access= new ElementAccess.Default(node);
access.flags= ElementAccess.A_WRITE;
final String mainName= resolveElementName(argValue, access, false);
diff --git a/r/org.eclipse.statet.r.core/src/org/eclipse/statet/r/core/model/RCoreFunctions.java b/r/org.eclipse.statet.r.core/src/org/eclipse/statet/r/core/model/RCoreFunctions.java
index 042e537..f2e5229 100644
--- a/r/org.eclipse.statet.r.core/src/org/eclipse/statet/r/core/model/RCoreFunctions.java
+++ b/r/org.eclipse.statet.r.core/src/org/eclipse/statet/r/core/model/RCoreFunctions.java
@@ -249,6 +249,7 @@
public final ArgsDefinition METHODS_DUMPMETHODS_args;
public static final String METHODS_SLOT_NAME= "slot";
+ public static final String METHODS_SLOT_assign_NAME= "slot<-";
public final ArgsDefinition METHODS_SLOT_args;