File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
jvm/src/test/scala/effekt/core
shared/src/main/scala/effekt/core Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -124,16 +124,15 @@ class NewNormalizerTests extends CoreTests {
124124 // This example shows a box that contains an extern reference.
125125 // The normalizer is able to unbox this indirection away.
126126 test(" extern in box" ) {
127- val input =
128- """
127+ val input = """
129128 |extern def foo: Int = vm"42"
130129 |
131130 |def run(): Int = {
132131 | val f = box {
133- | foo
132+ | box foo
134133 | } at { io }
135134 |
136- | val x = unbox f()()
135+ | val x = /* unbox */ f()()
137136 | return x
138137 |}
139138 |
Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ class EffektLexers extends Parsers {
9191 lazy val `at` = keyword(" at" )
9292 lazy val `in` = keyword(" in" )
9393 lazy val `box` = keyword(" box" )
94+ lazy val `unbox` = keyword(" unbox" )
9495 lazy val `return` = keyword(" return" )
9596 lazy val `region` = keyword(" region" )
9697 lazy val `resource` = keyword(" resource" )
@@ -381,6 +382,7 @@ class CoreParsers(names: Names) extends EffektLexers {
381382 // ------
382383 lazy val block : P [Block ] =
383384 ( blockVar
385+ | `unbox` ~> expr ^^ Block .Unbox .apply
384386 | `new` ~> implementation ^^ Block .New .apply
385387 | blockLit
386388 // TODO check left associative nesting (also for select)
You can’t perform that action at this time.
0 commit comments