File tree 1 file changed +8
-7
lines changed
chapi-domain/src/main/kotlin/chapi/domain/expr
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -11,21 +11,22 @@ package chapi.domain.expr
11
11
// }
12
12
sealed class Expression {
13
13
class BinOp (val lhs : ExpressionNode , val op : BinOpKind , val rhs : ExpressionNode ) : ExpressionNode {
14
- override fun toString (): String {
15
- return " $lhs $op $rhs "
16
- }
14
+ override fun toString () = " $lhs $op $rhs "
15
+ }
16
+
17
+ class UnaryOp (val lhs : ExpressionNode , val op : UnaryOpKind ) : ExpressionNode {
18
+ override fun toString (): String = " $op$lhs "
17
19
}
18
20
19
- class UnaryOp (lhs : ExpressionNode , op : UnaryOpKind ) : ExpressionNode
20
- class IntValue (val value : kotlin.Int ) : ExpressionNode {
21
+ class IntValue (val value : Int ) : ExpressionNode {
21
22
override fun toString () = value.toString()
22
23
}
23
24
24
- class Variable (val name : kotlin. String ) : ExpressionNode {
25
+ class Variable (val name : String ) : ExpressionNode {
25
26
override fun toString () = name
26
27
}
27
28
28
- class Identifier (val name : kotlin. String ) : ExpressionNode {
29
+ class Identifier (val name : String ) : ExpressionNode {
29
30
override fun toString () = name
30
31
}
31
32
You can’t perform that action at this time.
0 commit comments