@@ -24,7 +24,7 @@ object RuntimeEvaluationTree {
2424
2525 case class LocalVar (name : String , `type` : jdi.Type ) extends Assignable {
2626 override def prettyPrint (depth : Int ): String = {
27- val indent = " \t " * (depth + 1 )
27+ val indent = " " * (depth + 1 )
2828 s """ |LocalVar(
2929 | ${indent}name= $name,
3030 | ${indent}type= ${`type`}
@@ -35,7 +35,7 @@ object RuntimeEvaluationTree {
3535 case class InstanceField (field : jdi.Field , qualifier : RuntimeEvaluationTree ) extends Field {
3636 override lazy val `type` = field.`type`()
3737 override def prettyPrint (depth : Int ): String = {
38- val indent = " \t " * (depth + 1 )
38+ val indent = " " * (depth + 1 )
3939 s """ |InstanceField(
4040 | ${indent}field = $field,
4141 | ${indent}qualifier = ${qualifier.prettyPrint(depth + 1 )}
@@ -45,7 +45,7 @@ object RuntimeEvaluationTree {
4545 case class StaticField (field : jdi.Field ) extends Field {
4646 override lazy val `type` = field.`type`()
4747 override def prettyPrint (depth : Int ): String = {
48- val indent = " \t " * (depth + 1 )
48+ val indent = " " * (depth + 1 )
4949 s """ |StaticField(
5050 | ${indent}field = $field
5151 | ${indent.dropRight(1 )}) """ .stripMargin
@@ -59,7 +59,7 @@ object RuntimeEvaluationTree {
5959 ) extends CallMethod {
6060 override lazy val `type` = method.returnType()
6161 override def prettyPrint (depth : Int ): String = {
62- val indent = " \t " * (depth + 1 )
62+ val indent = " " * (depth + 1 )
6363 s """ |InstanceMethod(
6464 | ${indent}method = $method -> ${method.returnType()},
6565 | ${indent}args = ${args.map(_.prettyPrint(depth + 1 )).mkString(" ,\n " + indent)},
@@ -74,7 +74,7 @@ object RuntimeEvaluationTree {
7474 ) extends CallMethod {
7575 override lazy val `type` = method.returnType()
7676 override def prettyPrint (depth : Int ): String = {
77- val indent = " \t " * (depth + 1 )
77+ val indent = " " * (depth + 1 )
7878 s """ |CallStaticMethod(
7979 | ${indent}m= $method,
8080 | ${indent}args= ${args.map(_.prettyPrint(depth + 1 )).mkString(" ,\n " + indent)},
@@ -90,7 +90,7 @@ object RuntimeEvaluationTree {
9090 ) extends RuntimeEvaluationTree {
9191 override lazy val `type` = op.typeCheck(lhs.`type`, rhs.`type`)
9292 override def prettyPrint (depth : Int ): String = {
93- val indent = " \t " * (depth + 1 )
93+ val indent = " " * (depth + 1 )
9494 s """ |CallBinaryOp(
9595 | ${indent}lhs = ${lhs.prettyPrint(depth + 1 )},
9696 | ${indent}rhs = ${rhs.prettyPrint(depth + 1 )},
@@ -102,7 +102,7 @@ object RuntimeEvaluationTree {
102102 case class ArrayElem (array : RuntimeEvaluationTree , index : RuntimeEvaluationTree , `type` : jdi.Type )
103103 extends RuntimeEvaluationTree {
104104 override def prettyPrint (depth : Int ): String = {
105- val indent = " \t " * (depth + 1 )
105+ val indent = " " * (depth + 1 )
106106 s """ |ArrayElem(
107107 | ${indent}array = $array,
108108 | ${indent}index = $index
@@ -116,7 +116,7 @@ object RuntimeEvaluationTree {
116116 ) extends RuntimeEvaluationTree {
117117 override lazy val `type` = op.typeCheck(rhs.`type`)
118118 override def prettyPrint (depth : Int ): String = {
119- val indent = " \t " * (depth + 1 )
119+ val indent = " " * (depth + 1 )
120120 s """ |UnaryOpCall(
121121 | ${indent}rhs= ${rhs.prettyPrint(depth + 1 )},
122122 | ${indent}op= $op
@@ -127,7 +127,7 @@ object RuntimeEvaluationTree {
127127 case class NewInstance (init : CallStaticMethod ) extends RuntimeEvaluationTree {
128128 override lazy val `type` : jdi.ReferenceType = init.method.declaringType() // .asInstanceOf[jdi.ClassType]
129129 override def prettyPrint (depth : Int ): String = {
130- val indent = " \t " * (depth + 1 )
130+ val indent = " " * (depth + 1 )
131131 s """ |NewInstance(
132132 | ${indent}init= ${init.prettyPrint(depth + 1 )}
133133 | ${indent.dropRight(1 )}) """ .stripMargin
@@ -140,7 +140,7 @@ object RuntimeEvaluationTree {
140140
141141 case class StaticModule (`type` : jdi.ClassType ) extends RuntimeEvaluationTree {
142142 override def prettyPrint (depth : Int ): String = {
143- val indent = " \t " * (depth + 1 )
143+ val indent = " " * (depth + 1 )
144144 s """ |StaticModule(
145145 | ${indent}mod= ${`type`}
146146 | ${indent.dropRight(1 )}) """ .stripMargin
@@ -149,34 +149,42 @@ object RuntimeEvaluationTree {
149149
150150 case class NestedModule (`type` : jdi.ReferenceType , init : CallInstanceMethod ) extends RuntimeEvaluationTree {
151151 override def prettyPrint (depth : Int ): String = {
152- val indent = " \t " * (depth + 1 )
152+ val indent = " " * (depth + 1 )
153153 s """ |NestedModule(
154154 | ${indent}type = ${`type`}
155155 | ${indent}init = ${init.prettyPrint(depth + 1 )}
156156 | ${indent.dropRight(1 )}) """ .stripMargin
157157 }
158158 }
159159
160- case class Value (
161- value : Safe [JdiValue ],
162- `type` : jdi.Type
163- ) extends RuntimeEvaluationTree {
160+ case class Value (value : Safe [JdiValue ], `type` : jdi.Type ) extends RuntimeEvaluationTree {
164161 override def prettyPrint (depth : Int ): String = {
165- val indent = " \t " * (depth + 1 )
162+ val indent = " " * (depth + 1 )
166163 s """ |Value(
167164 | ${indent}v= $value,
168165 | ${indent}t= ${`type`}
169166 | ${indent.dropRight(1 )}) """ .stripMargin
170167 }
171168 }
169+
170+ case class Literal (value : Any , `type` : jdi.Type ) extends RuntimeEvaluationTree {
171+ override def prettyPrint (depth : Int ): String = {
172+ val indent = " " * (depth + 1 )
173+ s """ |Literal(
174+ | ${indent}v= $value,
175+ | ${indent}t= ${`type`}
176+ | ${indent.dropRight(1 )}) """ .stripMargin
177+ }
178+ }
179+
172180 case class If (
173181 p : RuntimeEvaluationTree ,
174182 thenp : RuntimeEvaluationTree ,
175183 elsep : RuntimeEvaluationTree ,
176184 `type` : jdi.Type
177185 ) extends RuntimeEvaluationTree {
178186 override def prettyPrint (depth : Int ): String = {
179- val indent = " \t " * (depth + 1 )
187+ val indent = " " * (depth + 1 )
180188 s """ |If(
181189 | ${indent}p= ${p.prettyPrint(depth + 1 )},
182190 | ${indent}ifTrue= ${thenp.prettyPrint(depth + 1 )},
@@ -192,7 +200,7 @@ object RuntimeEvaluationTree {
192200 `type` : jdi.Type
193201 ) extends RuntimeEvaluationTree {
194202 override def prettyPrint (depth : Int ): String = {
195- val indent = " \t " * (depth + 1 )
203+ val indent = " " * (depth + 1 )
196204 s """ |Assign(
197205 | ${indent}lhs= ${lhs.prettyPrint(depth + 1 )},
198206 | ${indent}rhs= ${rhs.prettyPrint(depth + 1 )},
0 commit comments