mirror of
https://github.com/github/codeql.git
synced 2026-02-08 03:01:10 +01:00
add getLeft/getRight helper predicates to disjunction/conjunction
This commit is contained in:
@@ -1125,9 +1125,15 @@ class Conjunction extends TConjunction, AstNode, Formula {
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Conjunction" }
|
||||
|
||||
/** Gets an operand to this formula. */
|
||||
/** Gets an operand to this conjunction. */
|
||||
Formula getAnOperand() { toQL(result) in [conj.getLeft(), conj.getRight()] }
|
||||
|
||||
/** Gets the left operand to this conjunction. */
|
||||
Formula getLeft() { toQL(result) = conj.getLeft() }
|
||||
|
||||
/** Gets the right operand to this conjunction. */
|
||||
Formula getRight() { toQL(result) = conj.getRight() }
|
||||
|
||||
override AstNode getAChild(string pred) {
|
||||
result = super.getAChild(pred)
|
||||
or
|
||||
@@ -1143,9 +1149,15 @@ class Disjunction extends TDisjunction, AstNode, Formula {
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Disjunction" }
|
||||
|
||||
/** Gets an operand to this formula. */
|
||||
/** Gets an operand to this disjunction. */
|
||||
Formula getAnOperand() { toQL(result) in [disj.getLeft(), disj.getRight()] }
|
||||
|
||||
/** Gets the left operand to this disjunction */
|
||||
Formula getLeft() { toQL(result) = disj.getLeft() }
|
||||
|
||||
/** Gets the right operand to this disjunction */
|
||||
Formula getRight() { toQL(result) = disj.getRight() }
|
||||
|
||||
override AstNode getAChild(string pred) {
|
||||
result = super.getAChild(pred)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user