Skip to content

Commit 5df87d5

Browse files
committed
Sync files
1 parent 884d3b2 commit 5df87d5

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/AccessPathSyntax.qll

+7
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
}

java/ql/lib/semmle/code/java/dataflow/internal/AccessPathSyntax.qll

+7
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
}

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

+7
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)