@@ -57,6 +57,9 @@ newtype TParameterPosition =
57
57
// parameter positions available.
58
58
FlowSummaryImpl:: ParsePositions:: isParsedPositionalArgumentPosition ( _, index )
59
59
} or
60
+ TPositionalParameterLowerBoundPosition ( int pos ) {
61
+ FlowSummaryImpl:: ParsePositions:: isParsedArgumentLowerBoundPosition ( _, pos )
62
+ } or
60
63
TKeywordParameterPosition ( string name ) {
61
64
name = any ( Parameter p ) .getName ( )
62
65
or
@@ -91,6 +94,9 @@ class ParameterPosition extends TParameterPosition {
91
94
/** Holds if this position represents a positional parameter at (0-based) `index`. */
92
95
predicate isPositional ( int index ) { this = TPositionalParameterPosition ( index ) }
93
96
97
+ /** Holds if this position represents any positional parameter starting from position `pos`. */
98
+ predicate isPositionalLowerBound ( int pos ) { this = TPositionalParameterLowerBoundPosition ( pos ) }
99
+
94
100
/** Holds if this position represents a keyword parameter named `name`. */
95
101
predicate isKeyword ( string name ) { this = TKeywordParameterPosition ( name ) }
96
102
@@ -123,6 +129,8 @@ class ParameterPosition extends TParameterPosition {
123
129
or
124
130
exists ( int index | this .isPositional ( index ) and result = "position " + index )
125
131
or
132
+ exists ( int pos | this .isPositionalLowerBound ( pos ) and result = "position " + pos + ".." )
133
+ or
126
134
exists ( string name | this .isKeyword ( name ) and result = "keyword " + name )
127
135
or
128
136
exists ( int index | this .isStarArgs ( index ) and result = "*args at " + index )
@@ -211,6 +219,10 @@ predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) {
211
219
or
212
220
exists ( int index | ppos .isPositional ( index ) and apos .isPositional ( index ) )
213
221
or
222
+ exists ( int index1 , int index2 |
223
+ ppos .isPositionalLowerBound ( index1 ) and apos .isPositional ( index2 ) and index2 >= index1
224
+ )
225
+ or
214
226
exists ( string name | ppos .isKeyword ( name ) and apos .isKeyword ( name ) )
215
227
or
216
228
exists ( int index | ppos .isStarArgs ( index ) and apos .isStarArgs ( index ) )
@@ -360,6 +372,10 @@ abstract class DataFlowFunction extends DataFlowCallable, TFunction {
360
372
result .getParameter ( ) = func .getArg ( index + this .positionalOffset ( ) )
361
373
)
362
374
or
375
+ exists ( int index1 , int index2 | ppos .isPositionalLowerBound ( index1 ) and index2 >= index1 |
376
+ result .getParameter ( ) = func .getArg ( index2 + this .positionalOffset ( ) )
377
+ )
378
+ or
363
379
exists ( string name | ppos .isKeyword ( name ) | result .getParameter ( ) = func .getArgByName ( name ) )
364
380
or
365
381
// `*args`
0 commit comments