Skip to content

Commit 4e915f7

Browse files
committed
PS: Add unary expression AST class.
1 parent 8575c53 commit 4e915f7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

powershell/ql/lib/powershell.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import semmle.code.powershell.ScriptBlock
2222
import semmle.code.powershell.StringLiteral
2323
import semmle.code.powershell.AssignmentStatement
2424
import semmle.code.powershell.BinaryExpression
25+
import semmle.code.powershell.UnaryExpression
2526
import semmle.code.powershell.ScriptBlockExpr
2627
import semmle.code.powershell.TernaryExpression
2728
import semmle.code.powershell.UsingExpression
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import powershell
2+
3+
class UnaryExpr extends @unary_expression, Expr {
4+
override SourceLocation getLocation() { unary_expression_location(this, result) }
5+
6+
int getKind() { unary_expression(this, _, result, _) }
7+
8+
Expr getOperand() { unary_expression(this, result, _, _) }
9+
}
10+
11+
class NotExpr extends UnaryExpr {
12+
NotExpr() { this.getKind() = 36 }
13+
14+
final override string toString() { result = "!..." }
15+
}

0 commit comments

Comments
 (0)