equal
deleted
inserted
replaced
111 |
111 |
112 //initial continuation |
112 //initial continuation |
113 def CPSi(e: Exp) = CPS(e)(KReturn) |
113 def CPSi(e: Exp) = CPS(e)(KReturn) |
114 |
114 |
115 //some testcases: |
115 //some testcases: |
|
116 // (1 + 2) * 3 |
|
117 println(CPSi(Aop("*", Aop("+", Num(1), Num(2)), Num(3))).toString) |
|
118 |
|
119 // 3 * (1 + 2) |
|
120 println(CPSi(Aop("*", Num(3), Aop("+", Num(1), Num(2)))).toString) |
|
121 |
|
122 //some testcases: |
|
123 |
116 // numbers and vars |
124 // numbers and vars |
117 println(CPSi(Num(1)).toString) |
125 println(CPSi(Num(1)).toString) |
118 println(CPSi(Var("z")).toString) |
126 println(CPSi(Var("z")).toString) |
119 |
127 |
120 // a * 3 |
128 // a * 3 |