Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb077be

Browse files
committed
sync AccessPathSyntax changes
1 parent dea5596 commit fb077be

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

python/ql/lib/semmle/python/frameworks/data/internal/AccessPathSyntax.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,16 @@ class AccessPathToken extends string {
167167
/** Gets the `n`th argument to this token, such as `x` or `y` from `Member[x,y]`. */
168168
string getArgument(int n) { result = this.getArgumentList().splitAt(",", n).trim() }
169169

170+
/** Gets the `n`th argument to this `name` token, such as `x` or `y` from `Member[x,y]`. */
171+
pragma[nomagic]
172+
string getArgument(string name, int n) { name = this.getName() and result = this.getArgument(n) }
173+
170174
/** Gets an argument to this token, such as `x` or `y` from `Member[x,y]`. */
171175
string getAnArgument() { result = this.getArgument(_) }
172176

177+
/** Gets an argument to this `name` token, such as `x` or `y` from `Member[x,y]`. */
178+
string getAnArgument(string name) { result = this.getArgument(name, _) }
179+
173180
/** Gets the number of arguments to this token, such as 2 for `Member[x,y]` or zero for `ReturnValue`. */
174181
int getNumArgument() { result = count(int n | exists(this.getArgument(n))) }
175182
}

0 commit comments

Comments
 (0)