Skip to content
Snippets Groups Projects
Commit 4b4339f2 authored by stepan's avatar stepan
Browse files

Fix arguments names in RPariList to AST conversion

parent c7a7b4ee
No related branches found
No related tags found
No related merge requests found
...@@ -42,8 +42,10 @@ public final class ArgumentsSignature implements Iterable<String> { ...@@ -42,8 +42,10 @@ public final class ArgumentsSignature implements Iterable<String> {
* argument can be provided with a name or without a name, or it may have default value, but * argument can be provided with a name or without a name, or it may have default value, but
* without any actual value provided by the caller. This is the case for {@code UNMATCHED}. Use * without any actual value provided by the caller. This is the case for {@code UNMATCHED}. Use
* {@link #isUnmatched(int)} for checking if argument is unmatched. * {@link #isUnmatched(int)} for checking if argument is unmatched.
*
* Note we intentionally use invalid argument name.
*/ */
public static final String UNMATCHED = new String(); public static final String UNMATCHED = "^";
public static final String VARARG_NAME = "..."; public static final String VARARG_NAME = "...";
public static final int[] EMPTY_VARARGS_INDEXES = new int[0]; public static final int[] EMPTY_VARARGS_INDEXES = new int[0];
public static final int NO_VARARG = -1; public static final int NO_VARARG = -1;
......
...@@ -718,7 +718,11 @@ public final class RPairList extends RSharingAttributeStorage implements RAbstra ...@@ -718,7 +718,11 @@ public final class RPairList extends RSharingAttributeStorage implements RAbstra
} else { } else {
String[] signature = new String[length - 1]; String[] signature = new String[length - 1];
for (int i = 0; i < names.getLength() && i < (length - 1); i++) { for (int i = 0; i < names.getLength() && i < (length - 1); i++) {
signature[i] = names.getDataAt(i + 1); String name = names.getDataAt(i + 1);
if (name != null && !name.isEmpty()) {
// in signatures, null is designated for unnamed arguments
signature[i] = name;
}
} }
return ArgumentsSignature.get(signature); return ArgumentsSignature.get(signature);
} }
......
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