|
40 | 40 | */
|
41 | 41 | package com.oracle.graal.python.parser.sst;
|
42 | 42 |
|
43 |
| -import com.oracle.graal.python.builtins.objects.function.Signature; |
44 |
| -import com.oracle.graal.python.nodes.expression.ExpressionNode; |
45 |
| -import com.oracle.graal.python.nodes.function.FunctionDefinitionNode; |
46 |
| -import com.oracle.graal.python.nodes.statement.StatementNode; |
47 |
| -import com.oracle.graal.python.parser.ScopeEnvironment; |
48 |
| -import com.oracle.graal.python.parser.ScopeInfo; |
49 | 43 | import java.util.ArrayList;
|
50 | 44 | import java.util.HashMap;
|
51 | 45 | import java.util.HashSet;
|
52 | 46 | import java.util.List;
|
53 | 47 | import java.util.Map;
|
54 | 48 | import java.util.Set;
|
55 | 49 |
|
| 50 | +import com.oracle.graal.python.builtins.objects.function.Signature; |
| 51 | +import com.oracle.graal.python.nodes.expression.ExpressionNode; |
| 52 | +import com.oracle.graal.python.nodes.function.FunctionDefinitionNode; |
| 53 | +import com.oracle.graal.python.nodes.statement.StatementNode; |
| 54 | +import com.oracle.graal.python.parser.ScopeEnvironment; |
| 55 | +import com.oracle.graal.python.parser.ScopeInfo; |
| 56 | + |
56 | 57 | public final class ArgDefListBuilder {
|
57 | 58 |
|
58 | 59 | private static final String SPLAT_MARKER_NAME = "*";
|
@@ -214,6 +215,8 @@ public boolean hasSplat() {
|
214 | 215 | }
|
215 | 216 |
|
216 | 217 | public boolean validateArgumentsAfterSplat() {
|
| 218 | + // Python requires to have named arguments following a bare '*' marker |
| 219 | + // Check that if there is '*', there are more named parameters than its position in the list |
217 | 220 | return !(splatIndex > -1 && args != null && args.get(splatIndex).name == null && paramNames.size() <= splatIndex);
|
218 | 221 | }
|
219 | 222 |
|
|
0 commit comments