File tree Expand file tree Collapse file tree
unified/ql/lib/codeql/unified/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55private import unified
66
77module Public {
8- /**
9- * A logical 'and' expression with short-circuiting.
10- */
8+ /** A short-circuiting logical AND expression. */
119 class LogicalAndExpr extends BinaryExpr {
1210 LogicalAndExpr ( ) { this .getOperator ( ) .getValue ( ) = "&&" }
11+ }
12+
13+ /** A short-circuiting logical OR expression. */
14+ class LogicalOrExpr extends BinaryExpr {
15+ LogicalOrExpr ( ) { this .getOperator ( ) .getValue ( ) = "||" }
16+ }
17+
18+ /** A short-circuiting null-coalescing expression. */
19+ class NullCoalescingExpr extends BinaryExpr {
20+ NullCoalescingExpr ( ) { this .getOperator ( ) .getValue ( ) = "??" }
21+ }
1322
14- Expr getAnOperand ( ) { result = [ this .getLeft ( ) , this .getRight ( ) ] }
23+ /** A logical NOT expression. */
24+ class LogicalNotExpr extends UnaryExpr {
25+ LogicalNotExpr ( ) { this .getOperator ( ) .( PrefixOperator ) .getValue ( ) = "!" }
1526 }
1627
1728 /**
Original file line number Diff line number Diff line change @@ -49,6 +49,12 @@ module Unified {
4949 }
5050 }
5151
52+ /** A binary expression. */
53+ class BinaryExpr extends G:: BinaryExpr {
54+ /** Gets an operand of this binary expression. */
55+ Expr getAnOperand ( ) { result = [ this .getLeft ( ) , this .getRight ( ) ] }
56+ }
57+
5258 /** A function call */
5359 class CallExpr extends G:: CallExpr {
5460 /** Gets the named argument with the given `name`. */
You can’t perform that action at this time.
0 commit comments