|
24 | 24 | * 3. The `path` column API-graph-like edges to follow starting at the node selected by `package` and `type`.
|
25 | 25 | * It is a `.`-separated list of tokens of form:
|
26 | 26 | * - Member[x] : a property named `x`. May be a comma-separated list of named.
|
27 |
| - * - Argument[n]: the n-th argument to a call. May be a range of form `x-y` (inclusive). |
28 |
| - * - Parameter[n]: the n-th parameter of a callback. May be a range of form `x-y` (inclusive). |
| 27 | + * - Argument[n]: the n-th argument to a call. May be a range of form `x-y` (inclusive) and/or a comma-separated list. |
| 28 | + * - Parameter[n]: the n-th parameter of a callback. May be a range of form `x-y` (inclusive) and/or a comma-separated list. |
29 | 29 | * - ReturnValue: the value returned by a function call
|
30 | 30 | * - Instance: the value returned by a constructor call
|
31 | 31 | * - Awaited: the value from a resolved promise/future-like object
|
@@ -383,20 +383,20 @@ private string getApiGraphLabelFromPathToken(string token) {
|
383 | 383 | // use-node represents be an argument, and an edge originating from a def-node represents a parameter.
|
384 | 384 | // We just map both to the same thing.
|
385 | 385 | token = ["Argument[" + arg + "]", "Parameter[" + arg + "]"] and
|
386 |
| - result = API::EdgeLabel::parameterByStringIndex(arg) |
| 386 | + exists(string part | part = arg.splitAt(",") | |
| 387 | + result = API::EdgeLabel::parameterByStringIndex(part) |
| 388 | + or |
| 389 | + exists(string lo, string hi | |
| 390 | + lo = part.regexpCapture("(\\d+)-(\\d+)", 1) and |
| 391 | + hi = part.regexpCapture("(\\d+)-(\\d+)", 2) and |
| 392 | + result = API::EdgeLabel::parameter([lo.toInt() .. hi.toInt()]) |
| 393 | + ) |
| 394 | + ) |
387 | 395 | or
|
388 | 396 | token = "Member[" + arg + "]" and
|
389 | 397 | result = API::EdgeLabel::member(arg.splitAt(","))
|
390 | 398 | )
|
391 | 399 | or
|
392 |
| - exists(string lo, string hi, string regexp | |
393 |
| - // For tokens like Argument[1-5] we just enumerate the whole range of corresponding edge labels |
394 |
| - regexp = "(?:Argument|Parameter)\\[(\\d+)-(\\d+)\\]" and |
395 |
| - lo = token.regexpCapture(regexp, 1) and |
396 |
| - hi = token.regexpCapture(regexp, 2) and |
397 |
| - result = API::EdgeLabel::parameter([lo.toInt() .. hi.toInt()]) |
398 |
| - ) |
399 |
| - or |
400 | 400 | token = "ReturnValue" and
|
401 | 401 | result = API::EdgeLabel::return()
|
402 | 402 | or
|
|
0 commit comments