File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
csharp/ql/lib/semmle/code/csharp/dataflow/internal
javascript/ql/lib/semmle/javascript/frameworks/data/internal
java/ql/lib/semmle/code/java/dataflow/internal Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments