Skip to content

Commit 202366e

Browse files
committed
Unified: Add predicates to TupleExpr and FunctionExpr
1 parent 5f0b516 commit 202366e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎unified/ql/lib/codeql/unified/internal/FacadeAst.qll‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ module Unified {
209209
}
210210
}
211211

212+
/** A tuple expression. */
213+
class TupleExpr extends G::TupleExpr {
214+
/** Gets the number of elements in this tuple expression. */
215+
int getNumberOfElements() { result = count(this.getAnElement()) }
216+
}
217+
212218
class TypeAliasDeclaration extends G::TypeAliasDeclaration {
213219
/** Gets the name of this type alias. */
214220
string getName() { result = this.getNameNode().getValue() }
@@ -261,4 +267,10 @@ module Unified {
261267
/** Gets the number of arguments passed to this call, not counting implicit arguments like receiver. */
262268
int getNumberOfArguments() { result = count(this.getAnArgument()) }
263269
}
270+
271+
/** A function expression. */
272+
class FunctionExpr extends G::FunctionExpr {
273+
/** Gets the number of parameters of this function. */
274+
int getNumberOfParameters() { result = count(this.getAParameter()) }
275+
}
264276
}

0 commit comments

Comments
 (0)