Skip to content

Commit cf3c54b

Browse files
committed
Unified: Add predicates to TupleExpr and FunctionExpr
1 parent 11e19d9 commit cf3c54b

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
@@ -217,6 +217,12 @@ module Unified {
217217
}
218218
}
219219

220+
/** A tuple expression. */
221+
class TupleExpr extends G::TupleExpr {
222+
/** Gets the number of elements in this tuple expression. */
223+
int getNumberOfElements() { result = count(this.getAnElement()) }
224+
}
225+
220226
class TypeAliasDeclaration extends G::TypeAliasDeclaration {
221227
/** Gets the name of this type alias. */
222228
string getName() { result = this.getNameNode().getValue() }
@@ -274,4 +280,10 @@ module Unified {
274280
result = count(Argument arg | arg = this.getAnArgument() and arg.isPositional())
275281
}
276282
}
283+
284+
/** A function expression. */
285+
class FunctionExpr extends G::FunctionExpr {
286+
/** Gets the number of parameters of this function. */
287+
int getNumberOfParameters() { result = count(this.getAParameter()) }
288+
}
277289
}

0 commit comments

Comments
 (0)