@@ -2,7 +2,7 @@ import python
22
33import Testing.Mox
44
5- private int varargs_length ( Call call ) {
5+ private int varargs_length_objectapi ( Call call ) {
66 not exists ( call .getStarargs ( ) ) and result = 0
77 or
88 exists ( TupleObject t |
@@ -14,7 +14,7 @@ private int varargs_length(Call call) {
1414}
1515
1616/** Gets a keyword argument that is not a keyword-only parameter. */
17- private Keyword not_keyword_only_arg ( Call call , FunctionObject func ) {
17+ private Keyword not_keyword_only_arg_objectapi ( Call call , FunctionObject func ) {
1818 func .getACall ( ) .getNode ( ) = call and
1919 result = call .getAKeyword ( ) and
2020 not func .getFunction ( ) .getAKeywordOnlyArg ( ) .getId ( ) = result .getArg ( )
@@ -26,26 +26,26 @@ private Keyword not_keyword_only_arg(Call call, FunctionObject func) {
2626 * plus the number of keyword arguments that do not match keyword-only arguments (if the function does not take **kwargs).
2727 */
2828
29- private int positional_arg_count_for_call ( Call call , Object callable ) {
30- call = get_a_call ( callable ) .getNode ( ) and
29+ private int positional_arg_count_for_call_objectapi ( Call call , Object callable ) {
30+ call = get_a_call_objectapi ( callable ) .getNode ( ) and
3131 exists ( int positional_keywords |
3232 exists ( FunctionObject func | func = get_function_or_initializer ( callable ) |
3333 not func .getFunction ( ) .hasKwArg ( ) and
34- positional_keywords = count ( not_keyword_only_arg ( call , func ) )
34+ positional_keywords = count ( not_keyword_only_arg_objectapi ( call , func ) )
3535 or
3636 func .getFunction ( ) .hasKwArg ( ) and positional_keywords = 0
3737 )
3838 |
39- result = count ( call .getAnArg ( ) ) + varargs_length ( call ) + positional_keywords
39+ result = count ( call .getAnArg ( ) ) + varargs_length_objectapi ( call ) + positional_keywords
4040 )
4141}
4242
4343int arg_count ( Call call ) {
44- result = count ( call .getAnArg ( ) ) + varargs_length ( call ) + count ( call .getAKeyword ( ) )
44+ result = count ( call .getAnArg ( ) ) + varargs_length_objectapi ( call ) + count ( call .getAKeyword ( ) )
4545}
4646
4747/* Gets a call corresponding to the given class or function*/
48- private ControlFlowNode get_a_call ( Object callable ) {
48+ private ControlFlowNode get_a_call_objectapi ( Object callable ) {
4949 result = callable .( ClassObject ) .getACall ( )
5050 or
5151 result = callable .( FunctionObject ) .getACall ( )
@@ -63,7 +63,7 @@ FunctionObject get_function_or_initializer(Object func_or_cls) {
6363predicate illegally_named_parameter ( Call call , Object func , string name ) {
6464 not func .isC ( ) and
6565 name = call .getANamedArgumentName ( ) and
66- call .getAFlowNode ( ) = get_a_call ( func ) and
66+ call .getAFlowNode ( ) = get_a_call_objectapi ( func ) and
6767 not get_function_or_initializer ( func ) .isLegalArgumentName ( name )
6868}
6969
@@ -84,7 +84,7 @@ predicate too_few_args(Call call, Object callable, int limit) {
8484 call = func .getAMethodCall ( ) .getNode ( ) and limit = func .minParameters ( ) - 1
8585 or
8686 callable instanceof ClassObject and
87- call .getAFlowNode ( ) = get_a_call ( callable ) and limit = func .minParameters ( ) - 1
87+ call .getAFlowNode ( ) = get_a_call_objectapi ( callable ) and limit = func .minParameters ( ) - 1
8888 )
8989}
9090
@@ -101,9 +101,9 @@ predicate too_many_args(Call call, Object callable, int limit) {
101101 call = func .getAMethodCall ( ) .getNode ( ) and limit = func .maxParameters ( ) - 1
102102 or
103103 callable instanceof ClassObject and
104- call .getAFlowNode ( ) = get_a_call ( callable ) and limit = func .maxParameters ( ) - 1
104+ call .getAFlowNode ( ) = get_a_call_objectapi ( callable ) and limit = func .maxParameters ( ) - 1
105105 ) and
106- positional_arg_count_for_call ( call , callable ) > limit
106+ positional_arg_count_for_call_objectapi ( call , callable ) > limit
107107}
108108
109109/** Holds if `call` has too many or too few arguments for `func` */
0 commit comments