@@ -36,7 +36,7 @@ public class Arity {
36
36
private final int minNumOfArgs ;
37
37
private final int maxNumOfArgs ;
38
38
39
- private final boolean takesKeywordArg ;
39
+ private final boolean takesKeywordArgs ;
40
40
private final boolean takesVarArgs ;
41
41
42
42
@ CompilationFinal (dimensions = 1 ) private final String [] parameterIds ;
@@ -46,42 +46,50 @@ public Arity(String functionName, int minNumOfArgs, int maxNumOfArgs, List<Strin
46
46
this .functionName = functionName ;
47
47
this .minNumOfArgs = minNumOfArgs ;
48
48
this .maxNumOfArgs = maxNumOfArgs ;
49
- this .takesKeywordArg = true ;
49
+ this .takesKeywordArgs = true ;
50
50
this .takesVarArgs = false ;
51
51
this .parameterIds = parameterIds .toArray (new String [0 ]);
52
52
this .keywordNames = keywordNames .toArray (new String [0 ]);
53
53
}
54
54
55
- public Arity (String functionName , int minNumOfArgs , int maxNumOfArgs , boolean takesKeywordArg , boolean takesVarArgs , List <String > parameterIds , List <String > keywordNames ) {
55
+ public Arity (String functionName , int minNumOfArgs , int maxNumOfArgs , boolean takesKeywordArgs , boolean takesVarArgs , List <String > parameterIds , List <String > keywordNames ) {
56
56
this .functionName = functionName ;
57
57
this .minNumOfArgs = minNumOfArgs ;
58
58
this .maxNumOfArgs = maxNumOfArgs ;
59
- this .takesKeywordArg = takesKeywordArg ;
59
+ this .takesKeywordArgs = takesKeywordArgs ;
60
60
this .takesVarArgs = takesVarArgs ;
61
61
this .parameterIds = parameterIds .toArray (new String [0 ]);
62
62
this .keywordNames = keywordNames .toArray (new String [0 ]);
63
63
}
64
64
65
- public Arity (String functionName , int minNumOfArgs , int maxNumOfArgs , boolean takesKeywordArg , boolean takesVarArgs , String [] parameterIds , String [] keywordNames ) {
65
+ public Arity (String functionName , int minNumOfArgs , int maxNumOfArgs , boolean takesKeywordArgs , boolean takesVarArgs , String [] parameterIds , String [] keywordNames ) {
66
66
this .functionName = functionName ;
67
67
this .minNumOfArgs = minNumOfArgs ;
68
68
this .maxNumOfArgs = maxNumOfArgs ;
69
- this .takesKeywordArg = takesKeywordArg ;
69
+ this .takesKeywordArgs = takesKeywordArgs ;
70
70
this .takesVarArgs = takesVarArgs ;
71
71
this .parameterIds = parameterIds ;
72
72
this .keywordNames = keywordNames ;
73
73
}
74
74
75
+ public static Arity createOneArgument (String functionName ) {
76
+ return new Arity (functionName , 1 , 1 , new ArrayList <String >(), new ArrayList <String >());
77
+ }
78
+
75
79
public boolean takesVarArgs () {
76
80
return takesVarArgs ;
77
81
}
78
82
79
- public boolean takesKeywordArg () {
80
- return takesKeywordArg ;
83
+ public boolean takesKeywordArgs () {
84
+ return takesKeywordArgs ;
81
85
}
82
86
83
- public static Arity createOneArgument (String functionName ) {
84
- return new Arity (functionName , 1 , 1 , new ArrayList <String >(), new ArrayList <String >());
87
+ public boolean takesFixedNumberOfArguments () {
88
+ if (takesVarArgs || takesKeywordArgs ) {
89
+ return false ;
90
+ } else {
91
+ return minNumOfArgs == maxNumOfArgs ;
92
+ }
85
93
}
86
94
87
95
public int getMinNumOfArgs () {
@@ -104,7 +112,7 @@ public String[] getParameterIds() {
104
112
return parameterIds ;
105
113
}
106
114
107
- public int parametersSize () {
115
+ public int getNumberOfParameters () {
108
116
return parameterIds .length ;
109
117
}
110
118
0 commit comments