@@ -5,7 +5,17 @@ class CallExpr extends Expr, TCallExpr {
55 Expr getArgument ( int i ) { none ( ) }
66
77 /** Gets the name that is used to select the callee. */
8- string getName ( ) { none ( ) }
8+ string getLowerCaseName ( ) { none ( ) }
9+
10+ /** Holds if `name` is the name of this call. The name is case insensitive. */
11+ bindingset [ name]
12+ pragma [ inline_late]
13+ final predicate matchesName ( string name ) { this .getLowerCaseName ( ) = name .toLowerCase ( ) }
14+
15+ /** Gets a name that case-insensitively matches the name of this call. */
16+ bindingset [ result ]
17+ pragma [ inline_late]
18+ final string getAName ( ) { result .toLowerCase ( ) = this .getLowerCaseName ( ) }
919
1020 /** Gets the i'th positional argument to this call. */
1121 Expr getPositionalArgument ( int i ) { none ( ) }
@@ -32,7 +42,7 @@ class CallExpr extends Expr, TCallExpr {
3242 exists ( Pipeline p , int i | this = p .getComponent ( i + 1 ) and result = p .getComponent ( i ) )
3343 }
3444
35- final override string toString ( ) { result = "Call to " + this .getName ( ) }
45+ final override string toString ( ) { result = "Call to " + this .getLowerCaseName ( ) }
3646
3747 predicate isStatic ( ) { none ( ) }
3848}
@@ -44,7 +54,15 @@ class Argument extends Expr {
4454
4555 int getPosition ( ) { this = call .getPositionalArgument ( result ) }
4656
47- string getName ( ) { this = call .getNamedArgument ( result ) }
57+ string getLowerCaseName ( ) { this = call .getNamedArgument ( result ) }
58+
59+ bindingset [ name]
60+ pragma [ inline_late]
61+ final predicate matchesName ( string name ) { this .getLowerCaseName ( ) = name .toLowerCase ( ) }
62+
63+ bindingset [ result ]
64+ pragma [ inline_late]
65+ final string getAName ( ) { result .toLowerCase ( ) = this .getLowerCaseName ( ) }
4866
4967 CallExpr getCall ( ) { result = call }
5068}
0 commit comments