Skip to content

Commit 0154f4e

Browse files
committed
QL: add getLeft/getRight helper predicates to disjunction/conjunction
1 parent 7c82c5e commit 0154f4e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

ql/src/codeql_ql/ast/Ast.qll

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,9 +1125,15 @@ class Conjunction extends TConjunction, AstNode, Formula {
11251125

11261126
override string getAPrimaryQlClass() { result = "Conjunction" }
11271127

1128-
/** Gets an operand to this formula. */
1128+
/** Gets an operand to this conjunction. */
11291129
Formula getAnOperand() { toQL(result) in [conj.getLeft(), conj.getRight()] }
11301130

1131+
/** Gets the left operand to this conjunction. */
1132+
Formula getLeft() { toQL(result) = conj.getLeft() }
1133+
1134+
/** Gets the right operand to this conjunction. */
1135+
Formula getRight() { toQL(result) = conj.getRight() }
1136+
11311137
override AstNode getAChild(string pred) {
11321138
result = super.getAChild(pred)
11331139
or
@@ -1143,9 +1149,15 @@ class Disjunction extends TDisjunction, AstNode, Formula {
11431149

11441150
override string getAPrimaryQlClass() { result = "Disjunction" }
11451151

1146-
/** Gets an operand to this formula. */
1152+
/** Gets an operand to this disjunction. */
11471153
Formula getAnOperand() { toQL(result) in [disj.getLeft(), disj.getRight()] }
11481154

1155+
/** Gets the left operand to this disjunction */
1156+
Formula getLeft() { toQL(result) = disj.getLeft() }
1157+
1158+
/** Gets the right operand to this disjunction */
1159+
Formula getRight() { toQL(result) = disj.getRight() }
1160+
11491161
override AstNode getAChild(string pred) {
11501162
result = super.getAChild(pred)
11511163
or

0 commit comments

Comments
 (0)