From ffb65f00615ba524298b39e676debf45af4a13cb Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 24 Oct 2011 16:34:55 +0000 Subject: First end-to-end implementation of a runtime re... First end-to-end implementation of a runtime reflexive compiler that generates and loads bytecodes. Review by szeiger. --- src/partest/scala/tools/partest/utils/CodeTest.scala | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/partest') diff --git a/src/partest/scala/tools/partest/utils/CodeTest.scala b/src/partest/scala/tools/partest/utils/CodeTest.scala index 544b95a00d..c90168a313 100644 --- a/src/partest/scala/tools/partest/utils/CodeTest.scala +++ b/src/partest/scala/tools/partest/utils/CodeTest.scala @@ -18,14 +18,18 @@ import scala.tools.nsc.Settings /** Runner for testing code tree liftingg */ object CodeTest { + def static[T](code: () => T, args: Array[String] = Array()) = { + println("static: "+code()) + } + def apply[T](code: Code[T], args: Array[String] = Array()) = { println("testing: "+code.tree) val reporter = new ConsoleReporter(new Settings) val toolbox = new ToolBox(reporter, args mkString " ") val ttree = toolbox.typeCheck(code.tree, code.manifest.tpe) println("result = " + toolbox.showAttributed(ttree)) - //val evaluated = toolbox.runExpr(ttree) - //println("evaluated = "+evaluated) - //evaluated + val evaluated = toolbox.runExpr(ttree) + println("evaluated = "+evaluated) + evaluated } } -- cgit v1.2.3