summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-09-14 16:40:46 +0200
committerEugene Burmako <xeno.by@gmail.com>2012-09-15 00:55:51 +0200
commitba3a9e05a6276fec976f4e53923e70b58b9f647b (patch)
tree760044e050d6aced6bf1f1c23c720ed5f7ae1289
parent4767fc21c6f9c8266ba98505c6a5ea2c95107e65 (diff)
downloadscala-ba3a9e05a6276fec976f4e53923e70b58b9f647b.tar.gz
scala-ba3a9e05a6276fec976f4e53923e70b58b9f647b.tar.bz2
scala-ba3a9e05a6276fec976f4e53923e70b58b9f647b.zip
SI-6342 cleans up toolbox API
1) parseExpr => parse 2) runExpr => eval 3) Introduces compile(Tree): () => Any, since it has frequent uses
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Evals.scala2
-rw-r--r--src/compiler/scala/reflect/macros/runtime/Parsers.scala2
-rw-r--r--src/compiler/scala/reflect/reify/utils/NodePrinters.scala2
-rw-r--r--src/compiler/scala/tools/reflect/ToolBox.scala13
-rw-r--r--src/compiler/scala/tools/reflect/ToolBoxFactory.scala47
-rw-r--r--src/compiler/scala/tools/reflect/package.scala2
-rw-r--r--src/reflect/scala/reflect/macros/Infrastructure.scala2
-rw-r--r--src/reflect/scala/reflect/macros/Parsers.scala2
-rw-r--r--test/files/neg/reify_ann2b.scala2
-rw-r--r--test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala2
-rw-r--r--test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala2
-rw-r--r--test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala2
-rw-r--r--test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala2
-rw-r--r--test/files/neg/reify_nested_inner_refers_to_local.scala2
-rw-r--r--test/files/pos/t4579.scala16
-rw-r--r--test/files/run/macro-abort-fresh/Test_2.scala2
-rw-r--r--test/files/run/macro-def-infer-return-type-b/Test_2.scala2
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala2
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidret-nontypeable/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidusage-badret/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidusage-partialapplication/Test_2.scala2
-rw-r--r--test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala2
-rw-r--r--test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala2
-rw-r--r--test/files/run/macro-reify-freevars/Test_2.scala2
-rw-r--r--test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala2
-rw-r--r--test/files/run/macro-reify-splice-outside-reify/Test_2.scala2
-rw-r--r--test/files/run/macro-reify-tagless-a/Test_2.scala2
-rw-r--r--test/files/run/reify_ann1a.scala2
-rw-r--r--test/files/run/reify_ann1b.scala2
-rw-r--r--test/files/run/reify_ann2a.scala2
-rw-r--r--test/files/run/reify_ann3.scala2
-rw-r--r--test/files/run/reify_ann4.scala2
-rw-r--r--test/files/run/reify_ann5.scala2
-rw-r--r--test/files/run/reify_classfileann_a.scala2
-rw-r--r--test/files/run/reify_classfileann_b.scala2
-rw-r--r--test/files/run/reify_closure1.scala2
-rw-r--r--test/files/run/reify_closure2a.scala2
-rw-r--r--test/files/run/reify_closure3a.scala2
-rw-r--r--test/files/run/reify_closure4a.scala2
-rw-r--r--test/files/run/reify_closure5a.scala2
-rw-r--r--test/files/run/reify_closure6.scala2
-rw-r--r--test/files/run/reify_closure7.scala2
-rw-r--r--test/files/run/reify_closure8a.scala2
-rw-r--r--test/files/run/reify_closure8b.scala2
-rw-r--r--test/files/run/reify_closures10.scala2
-rw-r--r--test/files/run/reify_copypaste1.scala6
-rw-r--r--test/files/run/reify_getter.scala2
-rw-r--r--test/files/run/reify_metalevel_breach_+0_refers_to_1.scala2
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala2
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala2
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_1.scala2
-rw-r--r--test/files/run/reify_nested_inner_refers_to_global.scala2
-rw-r--r--test/files/run/reify_nested_inner_refers_to_local.scala2
-rw-r--r--test/files/run/reify_nested_outer_refers_to_global.scala2
-rw-r--r--test/files/run/reify_nested_outer_refers_to_local.scala2
-rw-r--r--test/files/run/reify_newimpl_45.scala2
-rw-r--r--test/files/run/reify_printf.scala2
-rw-r--r--test/files/run/reify_typerefs_1a.scala2
-rw-r--r--test/files/run/reify_typerefs_1b.scala2
-rw-r--r--test/files/run/reify_typerefs_2a.scala2
-rw-r--r--test/files/run/reify_typerefs_2b.scala2
-rw-r--r--test/files/run/reify_typerefs_3a.scala2
-rw-r--r--test/files/run/reify_typerefs_3b.scala2
-rw-r--r--test/files/run/t5229_2.scala2
-rw-r--r--test/files/run/t5230.scala2
-rw-r--r--test/files/run/t5266_1.scala2
-rw-r--r--test/files/run/t5266_2.scala2
-rw-r--r--test/files/run/t5334_1.scala2
-rw-r--r--test/files/run/t5334_2.scala2
-rw-r--r--test/files/run/t6199-toolbox.scala2
-rw-r--r--test/files/run/toolbox_console_reporter.scala2
-rw-r--r--test/files/run/toolbox_default_reporter_is_silent.scala2
-rw-r--r--test/files/run/toolbox_silent_reporter.scala2
-rw-r--r--test/pending/neg/reify_packed.scala2
-rw-r--r--test/pending/run/macro-reify-tagless-b/Test_2.scala2
-rw-r--r--test/pending/run/reify_closure2b.scala2
-rw-r--r--test/pending/run/reify_closure3b.scala2
-rw-r--r--test/pending/run/reify_closure4b.scala2
-rw-r--r--test/pending/run/reify_closure5b.scala2
-rw-r--r--test/pending/run/reify_closure9a.scala2
-rw-r--r--test/pending/run/reify_closure9b.scala2
-rw-r--r--test/pending/run/reify_closures11.scala2
-rw-r--r--test/pending/run/reify_newimpl_09c.scala2
-rw-r--r--test/pending/run/reify_newimpl_46.scala2
-rw-r--r--test/pending/run/reify_newimpl_53.scala2
87 files changed, 126 insertions, 122 deletions
diff --git a/src/compiler/scala/reflect/macros/runtime/Evals.scala b/src/compiler/scala/reflect/macros/runtime/Evals.scala
index 348e29cdd7..acafeb5b02 100644
--- a/src/compiler/scala/reflect/macros/runtime/Evals.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Evals.scala
@@ -13,6 +13,6 @@ trait Evals {
def eval[T](expr: Expr[T]): T = {
val imported = evalImporter.importTree(expr.tree)
- evalToolBox.runExpr(imported).asInstanceOf[T]
+ evalToolBox.eval(imported).asInstanceOf[T]
}
} \ No newline at end of file
diff --git a/src/compiler/scala/reflect/macros/runtime/Parsers.scala b/src/compiler/scala/reflect/macros/runtime/Parsers.scala
index e4acf104e3..5096526fdb 100644
--- a/src/compiler/scala/reflect/macros/runtime/Parsers.scala
+++ b/src/compiler/scala/reflect/macros/runtime/Parsers.scala
@@ -12,7 +12,7 @@ trait Parsers {
// todo. provide decent implementation
try {
import scala.reflect.runtime.{universe => ru}
- val parsed = ru.rootMirror.mkToolBox().parseExpr(code)
+ val parsed = ru.rootMirror.mkToolBox().parse(code)
val importer = universe.mkImporter(ru)
importer.importTree(parsed)
} catch {
diff --git a/src/compiler/scala/reflect/reify/utils/NodePrinters.scala b/src/compiler/scala/reflect/reify/utils/NodePrinters.scala
index ec1f132c1b..c023be1a50 100644
--- a/src/compiler/scala/reflect/reify/utils/NodePrinters.scala
+++ b/src/compiler/scala/reflect/reify/utils/NodePrinters.scala
@@ -94,7 +94,7 @@ trait NodePrinters {
if (isExpr) {
if (mirror contains ".getClassLoader") {
printout += "import scala.tools.reflect.ToolBox"
- printout += s"println(${nme.MIRROR_SHORT}.mkToolBox().runExpr(tree))"
+ printout += s"println(${nme.MIRROR_SHORT}.mkToolBox().eval(tree))"
} else {
printout += "println(tree)"
}
diff --git a/src/compiler/scala/tools/reflect/ToolBox.scala b/src/compiler/scala/tools/reflect/ToolBox.scala
index 85e2b6543f..9e7d230a6a 100644
--- a/src/compiler/scala/tools/reflect/ToolBox.scala
+++ b/src/compiler/scala/tools/reflect/ToolBox.scala
@@ -80,18 +80,23 @@ trait ToolBox[U <: Universe] {
def resetLocalAttrs(tree: u.Tree): u.Tree
/** .. */
- def parseExpr(code: String): u.Tree
+ def parse(code: String): u.Tree
- /** Compiles and runs a tree using this ToolBox.
+ /** Compiles a tree using this ToolBox.
*
* If the tree has unresolved type variables (represented as instances of `FreeTypeSymbol` symbols),
* then they all have to be resolved first using `Tree.substituteTypes`, or an error occurs.
*
* This spawns the compiler at the Namer phase, and pipelines the tree through that compiler.
- * Currently `runExpr` does not accept trees that already typechecked, because typechecking isn't idempotent.
+ * Currently `compile` does not accept trees that already typechecked, because typechecking isn't idempotent.
* For more info, take a look at https://issues.scala-lang.org/browse/SI-5464.
*/
- def runExpr(tree: u.Tree): Any
+ def compile(tree: u.Tree): () => Any
+
+ /** Compiles and runs a tree using this ToolBox.
+ * Is equivalent to `compile(tree)()`.
+ */
+ def eval(tree: u.Tree): Any
}
/** Represents an error during toolboxing
diff --git a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
index b658491294..b671a2eb48 100644
--- a/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
+++ b/src/compiler/scala/tools/reflect/ToolBoxFactory.scala
@@ -47,7 +47,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
newTermName("__wrapper$" + wrapCount + "$" + java.util.UUID.randomUUID.toString.replace("-", ""))
}
- def verifyExpr(expr: Tree): Unit = {
+ def verify(expr: Tree): Unit = {
// Previously toolboxes used to typecheck their inputs before compiling.
// Actually, the initial demo by Martin first typechecked the reified tree,
// then ran it, which typechecked it again, and only then launched the
@@ -97,7 +97,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
}
def transformDuringTyper(expr0: Tree, withImplicitViewsDisabled: Boolean, withMacrosDisabled: Boolean)(transform: (analyzer.Typer, Tree) => Tree): Tree = {
- verifyExpr(expr0)
+ verify(expr0)
// need to wrap the expr, because otherwise you won't be able to typecheck macros against something that contains free vars
var (expr, freeTerms) = extractFreeTerms(expr0, wrapFreeTermRefs = false)
@@ -140,7 +140,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
unwrapped
}
- def typeCheckExpr(expr: Tree, pt: Type, silent: Boolean, withImplicitViewsDisabled: Boolean, withMacrosDisabled: Boolean): Tree =
+ def typeCheck(expr: Tree, pt: Type, silent: Boolean, withImplicitViewsDisabled: Boolean, withMacrosDisabled: Boolean): Tree =
transformDuringTyper(expr, withImplicitViewsDisabled = withImplicitViewsDisabled, withMacrosDisabled = withMacrosDisabled)(
(currentTyper, expr) => {
trace("typing (implicit views = %s, macros = %s): ".format(!withImplicitViewsDisabled, !withMacrosDisabled))(showAttributed(expr, true, true, settings.Yshowsymkinds.value))
@@ -170,10 +170,12 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
}
})
- def compileExpr(expr: Tree): (Object, java.lang.reflect.Method) = {
- verifyExpr(expr)
+ def compile(expr: Tree): () => Any = {
+ val freeTerms = expr.freeTerms // need to calculate them here, because later on they will be erased
+ val thunks = freeTerms map (fte => () => fte.value) // need to be lazy in order not to distort evaluation order
+ verify(expr)
- def wrapExpr(expr0: Tree): Tree = {
+ def wrap(expr0: Tree): Tree = {
val (expr, freeTerms) = extractFreeTerms(expr0, wrapFreeTermRefs = true)
val (obj, mclazz) = rootMirror.EmptyPackageClass.newModuleAndClassSymbol(
@@ -214,7 +216,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
cleanedUp
}
- val mdef = wrapExpr(expr)
+ val mdef = wrap(expr)
val pdef = PackageDef(Ident(nme.EMPTY_PACKAGE_NAME), List(mdef))
val unit = new CompilationUnit(NoSourceFile)
unit.body = pdef
@@ -231,12 +233,6 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
val jmeth = jclazz.getDeclaredMethods.find(_.getName == wrapperMethodName).get
val jfield = jclazz.getDeclaredFields.find(_.getName == NameTransformer.MODULE_INSTANCE_NAME).get
val singleton = jfield.get(null)
- (singleton, jmeth)
- }
-
- def runExpr(expr: Tree): Any = {
- val freeTerms = expr.freeTerms // need to calculate them here, because later on they will be erased
- val thunks = freeTerms map (fte => () => fte.value) // need to be lazy in order not to distort evaluation order
// @odersky writes: Not sure we will be able to drop this. I forgot the reason why we dereference () functions,
// but there must have been one. So I propose to leave old version in comments to be resurrected if the problem resurfaces.
@@ -250,13 +246,14 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
// val applyMeth = result.getClass.getMethod("apply")
// applyMeth.invoke(result)
// }
- val (singleton, jmeth) = compileExpr(expr)
- val result = jmeth.invoke(singleton, thunks map (_.asInstanceOf[AnyRef]): _*)
- if (jmeth.getReturnType == java.lang.Void.TYPE) ()
- else result
+ () => {
+ val result = jmeth.invoke(singleton, thunks map (_.asInstanceOf[AnyRef]): _*)
+ if (jmeth.getReturnType == java.lang.Void.TYPE) ()
+ else result
+ }
}
- def parseExpr(code: String): Tree = {
+ def parse(code: String): Tree = {
val run = new Run
reporter.reset()
val wrappedCode = "object wrapper {" + EOL + code + EOL + "}"
@@ -336,7 +333,7 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
var cexpectedType: compiler.Type = importer.importType(expectedType)
if (compiler.settings.verbose.value) println("typing "+ctree+", expectedType = "+expectedType)
- val ttree: compiler.Tree = compiler.typeCheckExpr(ctree, cexpectedType, silent = silent, withImplicitViewsDisabled = withImplicitViewsDisabled, withMacrosDisabled = withMacrosDisabled)
+ val ttree: compiler.Tree = compiler.typeCheck(ctree, cexpectedType, silent = silent, withImplicitViewsDisabled = withImplicitViewsDisabled, withMacrosDisabled = withMacrosDisabled)
val uttree = exporter.importTree(ttree)
uttree
}
@@ -379,20 +376,22 @@ abstract class ToolBoxFactory[U <: JavaUniverse](val u: U) { factorySelf =>
def showAttributed(tree: u.Tree, printTypes: Boolean = true, printIds: Boolean = true, printKinds: Boolean = false): String =
compiler.showAttributed(importer.importTree(tree), printTypes, printIds, printKinds)
- def parseExpr(code: String): u.Tree = {
+ def parse(code: String): u.Tree = {
if (compiler.settings.verbose.value) println("parsing "+code)
- val ctree: compiler.Tree = compiler.parseExpr(code)
+ val ctree: compiler.Tree = compiler.parse(code)
val utree = exporter.importTree(ctree)
utree
}
- def runExpr(tree: u.Tree): Any = {
+ def compile(tree: u.Tree): () => Any = {
if (compiler.settings.verbose.value) println("importing "+tree)
var ctree: compiler.Tree = importer.importTree(tree)
- if (compiler.settings.verbose.value) println("running "+ctree)
- compiler.runExpr(ctree)
+ if (compiler.settings.verbose.value) println("compiling "+ctree)
+ compiler.compile(ctree)
}
+
+ def eval(tree: u.Tree): Any = compile(tree)()
}
}
diff --git a/src/compiler/scala/tools/reflect/package.scala b/src/compiler/scala/tools/reflect/package.scala
index d5569e448d..901071d91a 100644
--- a/src/compiler/scala/tools/reflect/package.scala
+++ b/src/compiler/scala/tools/reflect/package.scala
@@ -27,7 +27,7 @@ package reflect {
def eval: T = {
val factory = new ToolBoxFactory[JavaUniverse](expr.mirror.universe) { val mirror = expr.mirror.asInstanceOf[this.u.Mirror] }
val toolBox = factory.mkToolBox()
- toolBox.runExpr(expr.tree.asInstanceOf[toolBox.u.Tree]).asInstanceOf[T]
+ toolBox.eval(expr.tree.asInstanceOf[toolBox.u.Tree]).asInstanceOf[T]
}
}
}
diff --git a/src/reflect/scala/reflect/macros/Infrastructure.scala b/src/reflect/scala/reflect/macros/Infrastructure.scala
index f01725cd1d..c195692832 100644
--- a/src/reflect/scala/reflect/macros/Infrastructure.scala
+++ b/src/reflect/scala/reflect/macros/Infrastructure.scala
@@ -43,7 +43,7 @@ trait Infrastructure {
* val importer = ru.mkImporter(c.universe).asInstanceOf[ru.Importer { val from: c.universe.type }]
* val tree = c.resetAllAttrs(x.tree.duplicate)
* val imported = importer.importTree(tree)
- * val valueOfX = toolBox.runExpr(imported).asInstanceOf[T]
+ * val valueOfX = toolBox.eval(imported).asInstanceOf[T]
* ...
* }
*/
diff --git a/src/reflect/scala/reflect/macros/Parsers.scala b/src/reflect/scala/reflect/macros/Parsers.scala
index ea87c5842e..1742d07b60 100644
--- a/src/reflect/scala/reflect/macros/Parsers.scala
+++ b/src/reflect/scala/reflect/macros/Parsers.scala
@@ -5,7 +5,7 @@ trait Parsers {
self: Context =>
/** .. */
- // todo. distinguish between `parseExpr` and `parse`
+ // todo. distinguish between `parse` and `parse`
def parse(code: String): Tree
/** Represents an error during parsing
diff --git a/test/files/neg/reify_ann2b.scala b/test/files/neg/reify_ann2b.scala
index 2076af34c8..72d8c611cb 100644
--- a/test/files/neg/reify_ann2b.scala
+++ b/test/files/neg/reify_ann2b.scala
@@ -24,5 +24,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala b/test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala
index 9499960480..e4d1edffc4 100644
--- a/test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala
+++ b/test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala
@@ -11,6 +11,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala b/test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala
index e6aaeb9426..7397441586 100644
--- a/test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala
+++ b/test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala
@@ -9,6 +9,6 @@ object Test extends App {
val code = reify{outer.splice.splice}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala b/test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala
index 16dcae8683..4f27a44f0c 100644
--- a/test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala
+++ b/test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala
@@ -13,6 +13,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala b/test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala
index 9600489f35..2f637301aa 100644
--- a/test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala
+++ b/test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala
@@ -11,6 +11,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/reify_nested_inner_refers_to_local.scala b/test/files/neg/reify_nested_inner_refers_to_local.scala
index fcbc1f7865..75ed1bf330 100644
--- a/test/files/neg/reify_nested_inner_refers_to_local.scala
+++ b/test/files/neg/reify_nested_inner_refers_to_local.scala
@@ -10,6 +10,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/pos/t4579.scala b/test/files/pos/t4579.scala
index 2404b19da1..8951ec011f 100644
--- a/test/files/pos/t4579.scala
+++ b/test/files/pos/t4579.scala
@@ -12,11 +12,11 @@ class LispTokenizer(s: String) extends Iterator[String] {
while (i < s.length() && s.charAt(i) <= ' ') i += 1
i < s.length()
}
- def next: String =
+ def next: String =
if (hasNext) {
val start = i
if (isDelimiter(s charAt i)) i += 1
- else
+ else
do i = i + 1
while (!isDelimiter(s charAt i))
s.substring(start, i)
@@ -235,7 +235,7 @@ object LispCaseClasses extends Lisp {
def string2lisp(s: String): Data = {
val it = new LispTokenizer(s);
- def parseExpr(token: String): Data = {
+ def parse(token: String): Data = {
if (token == "(") parseList
else if (token == ")") sys.error("unbalanced parentheses")
else if ('0' <= token.charAt(0) && token.charAt(0) <= '9')
@@ -246,9 +246,9 @@ object LispCaseClasses extends Lisp {
}
def parseList: Data = {
val token = it.next;
- if (token == ")") NIL() else CONS(parseExpr(token), parseList)
+ if (token == ")") NIL() else CONS(parse(token), parseList)
}
- parseExpr(it.next)
+ parse(it.next)
}
def lisp2string(d: Data): String = d.toString();
@@ -426,7 +426,7 @@ object LispAny extends Lisp {
def string2lisp(s: String): Data = {
val it = new LispTokenizer(s);
- def parseExpr(token: String): Data = {
+ def parse(token: String): Data = {
if (token == "(") parseList
else if (token == ")") sys.error("unbalanced parentheses")
//else if (Character.isDigit(token.charAt(0)))
@@ -438,9 +438,9 @@ object LispAny extends Lisp {
}
def parseList: List[Data] = {
val token = it.next;
- if (token == ")") Nil else parseExpr(token) :: parseList
+ if (token == ")") Nil else parse(token) :: parseList
}
- parseExpr(it.next)
+ parse(it.next)
}
}
diff --git a/test/files/run/macro-abort-fresh/Test_2.scala b/test/files/run/macro-abort-fresh/Test_2.scala
index c6caa2b585..15c498efb0 100644
--- a/test/files/run/macro-abort-fresh/Test_2.scala
+++ b/test/files/run/macro-abort-fresh/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Select(Ident("Macros"), newTermName("foo"))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-b/Test_2.scala b/test/files/run/macro-def-infer-return-type-b/Test_2.scala
index 0f84859545..ef2920a432 100644
--- a/test/files/run/macro-def-infer-return-type-b/Test_2.scala
+++ b/test/files/run/macro-def-infer-return-type-b/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
index c0319fcd6c..16d2c1e6ac 100644
--- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
@@ -7,6 +7,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(tpnme.WILDCARD_STAR))))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
index c6caa2b585..15c498efb0 100644
--- a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Select(Ident("Macros"), newTermName("foo"))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-nontypeable/Test_2.scala b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
index c6caa2b585..15c498efb0 100644
--- a/test/files/run/macro-invalidret-nontypeable/Test_2.scala
+++ b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Select(Ident("Macros"), newTermName("foo"))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-badret/Test_2.scala b/test/files/run/macro-invalidusage-badret/Test_2.scala
index 8322e8a4e0..f3a76f3fff 100644
--- a/test/files/run/macro-invalidusage-badret/Test_2.scala
+++ b/test/files/run/macro-invalidusage-badret/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Typed(Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42)))), Ident(newTypeName("String")))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala
index f51cc7e699..c91fd7d380 100644
--- a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala
+++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Select(Ident("Macros"), newTermName("foo"))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
index 64020b2aa9..cbfee725e2 100644
--- a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
+++ b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(40))))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
index 67666a632b..373c6a6fca 100644
--- a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
+++ b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
@@ -3,5 +3,5 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- println(cm.mkToolBox().runExpr(tree))
+ println(cm.mkToolBox().eval(tree))
}
diff --git a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala
index 7a2c0a6fa9..089f30f389 100644
--- a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala
+++ b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala
@@ -16,5 +16,5 @@ object Test extends App {
val macroapp = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
val tree = Block(macrodef, module, macroapp)
val toolbox = cm.mkToolBox(options = "-language:experimental.macros")
- println(toolbox.runExpr(tree))
+ println(toolbox.eval(tree))
}
diff --git a/test/files/run/macro-reify-freevars/Test_2.scala b/test/files/run/macro-reify-freevars/Test_2.scala
index 603cf10d41..e24758cfb4 100644
--- a/test/files/run/macro-reify-freevars/Test_2.scala
+++ b/test/files/run/macro-reify-freevars/Test_2.scala
@@ -6,6 +6,6 @@ object Test extends App {
val x = ValDef(NoMods, newTermName("x"), Ident("Int"), EmptyTree)
val fn = Function(List(x), Apply(Select(Ident(newTermName("x")), newTermName("$plus")), List(Literal(Constant("5")))))
val tree = Apply(Select(q, newTermName("map")), List(fn))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
index f3e1c9ae95..b23a5c70e1 100644
--- a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
+++ b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
@@ -15,7 +15,7 @@ object Impls {
val importer = ru.mkImporter(c.universe).asInstanceOf[ru.Importer { val from: c.universe.type }]
val tree = c.resetAllAttrs(x.tree.duplicate)
val imported = importer.importTree(tree)
- toolBox.runExpr(imported).asInstanceOf[T]
+ toolBox.eval(imported).asInstanceOf[T]
}
}
diff --git a/test/files/run/macro-reify-splice-outside-reify/Test_2.scala b/test/files/run/macro-reify-splice-outside-reify/Test_2.scala
index 5bca7db668..8f96ea199d 100644
--- a/test/files/run/macro-reify-splice-outside-reify/Test_2.scala
+++ b/test/files/run/macro-reify-splice-outside-reify/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- try println(cm.mkToolBox().runExpr(tree))
+ try println(cm.mkToolBox().eval(tree))
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-reify-tagless-a/Test_2.scala b/test/files/run/macro-reify-tagless-a/Test_2.scala
index 7029e59ea1..1bb3945ece 100644
--- a/test/files/run/macro-reify-tagless-a/Test_2.scala
+++ b/test/files/run/macro-reify-tagless-a/Test_2.scala
@@ -9,6 +9,6 @@ object Test extends App {
val rhs = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant("hello world"))))
val list = ValDef(NoMods, newTermName("list"), tpt, rhs)
val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name))))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/reify_ann1a.scala b/test/files/run/reify_ann1a.scala
index 754baef6b7..88b4191195 100644
--- a/test/files/run/reify_ann1a.scala
+++ b/test/files/run/reify_ann1a.scala
@@ -25,5 +25,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann1b.scala b/test/files/run/reify_ann1b.scala
index eb00b4cb10..a8fb876023 100644
--- a/test/files/run/reify_ann1b.scala
+++ b/test/files/run/reify_ann1b.scala
@@ -25,5 +25,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann2a.scala b/test/files/run/reify_ann2a.scala
index 9f901d86bd..b7e5833584 100644
--- a/test/files/run/reify_ann2a.scala
+++ b/test/files/run/reify_ann2a.scala
@@ -25,5 +25,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann3.scala b/test/files/run/reify_ann3.scala
index cbf1e10063..662d58aaf3 100644
--- a/test/files/run/reify_ann3.scala
+++ b/test/files/run/reify_ann3.scala
@@ -19,5 +19,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann4.scala b/test/files/run/reify_ann4.scala
index 58c8c2c521..a85e5e3625 100644
--- a/test/files/run/reify_ann4.scala
+++ b/test/files/run/reify_ann4.scala
@@ -23,5 +23,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann5.scala b/test/files/run/reify_ann5.scala
index 801db07960..877360180c 100644
--- a/test/files/run/reify_ann5.scala
+++ b/test/files/run/reify_ann5.scala
@@ -20,5 +20,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_classfileann_a.scala b/test/files/run/reify_classfileann_a.scala
index 0abb7b8154..1d51688e78 100644
--- a/test/files/run/reify_classfileann_a.scala
+++ b/test/files/run/reify_classfileann_a.scala
@@ -18,5 +18,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_classfileann_b.scala b/test/files/run/reify_classfileann_b.scala
index 5ceb652a8b..ef19e9240b 100644
--- a/test/files/run/reify_classfileann_b.scala
+++ b/test/files/run/reify_classfileann_b.scala
@@ -22,5 +22,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_closure1.scala b/test/files/run/reify_closure1.scala
index ce68975acc..af24a4b1e4 100644
--- a/test/files/run/reify_closure1.scala
+++ b/test/files/run/reify_closure1.scala
@@ -10,7 +10,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure2a.scala b/test/files/run/reify_closure2a.scala
index cb53e7ffa8..7a2cdb5e17 100644
--- a/test/files/run/reify_closure2a.scala
+++ b/test/files/run/reify_closure2a.scala
@@ -10,7 +10,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure3a.scala b/test/files/run/reify_closure3a.scala
index cf8c161afa..cb17c89501 100644
--- a/test/files/run/reify_closure3a.scala
+++ b/test/files/run/reify_closure3a.scala
@@ -12,7 +12,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure4a.scala b/test/files/run/reify_closure4a.scala
index 1521295f16..23436e0763 100644
--- a/test/files/run/reify_closure4a.scala
+++ b/test/files/run/reify_closure4a.scala
@@ -12,7 +12,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure5a.scala b/test/files/run/reify_closure5a.scala
index 84c2c08727..6b5089a4e5 100644
--- a/test/files/run/reify_closure5a.scala
+++ b/test/files/run/reify_closure5a.scala
@@ -10,7 +10,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure6.scala b/test/files/run/reify_closure6.scala
index d007e80899..cba035132d 100644
--- a/test/files/run/reify_closure6.scala
+++ b/test/files/run/reify_closure6.scala
@@ -17,7 +17,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure7.scala b/test/files/run/reify_closure7.scala
index 3d4956a724..2a7ce25e88 100644
--- a/test/files/run/reify_closure7.scala
+++ b/test/files/run/reify_closure7.scala
@@ -19,7 +19,7 @@ object Test extends App {
if (clo == null) {
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
clo = dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure8a.scala b/test/files/run/reify_closure8a.scala
index 8db3d38241..f303a7511c 100644
--- a/test/files/run/reify_closure8a.scala
+++ b/test/files/run/reify_closure8a.scala
@@ -9,7 +9,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(new Foo(10).fun.tree)
+ val dyn = toolbox.eval(new Foo(10).fun.tree)
val foo = dyn.asInstanceOf[Int]
println(foo)
} \ No newline at end of file
diff --git a/test/files/run/reify_closure8b.scala b/test/files/run/reify_closure8b.scala
index 9cdc0e997f..c693cb490e 100644
--- a/test/files/run/reify_closure8b.scala
+++ b/test/files/run/reify_closure8b.scala
@@ -11,7 +11,7 @@ object Test extends App {
}
try {
- val dyn = cm.mkToolBox().runExpr(new Foo(10).fun.tree)
+ val dyn = cm.mkToolBox().eval(new Foo(10).fun.tree)
val foo = dyn.asInstanceOf[Int]
println(foo)
} catch {
diff --git a/test/files/run/reify_closures10.scala b/test/files/run/reify_closures10.scala
index 2d9b833851..a2740c8362 100644
--- a/test/files/run/reify_closures10.scala
+++ b/test/files/run/reify_closures10.scala
@@ -9,5 +9,5 @@ object Test extends App {
val code = reify{println(x + y); x + y}
val toolbox = cm.mkToolBox()
- println(toolbox.runExpr(code.tree))
+ println(toolbox.eval(code.tree))
} \ No newline at end of file
diff --git a/test/files/run/reify_copypaste1.scala b/test/files/run/reify_copypaste1.scala
index 7eaa4fa7b5..c597b7af19 100644
--- a/test/files/run/reify_copypaste1.scala
+++ b/test/files/run/reify_copypaste1.scala
@@ -11,9 +11,9 @@ object Test extends App {
val toolBox = currentMirror.mkToolBox(options = "-Yreify-copypaste")
val reify = Select(Select(Select(Select(Ident(ScalaPackage), newTermName("reflect")), newTermName("runtime")), newTermName("universe")), newTermName("reify"))
val reifee = Block(List(ValDef(Modifiers(LAZY), newTermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(newTermName("x")))
- toolBox.runExpr(Apply(reify, List(reifee)))
- val Block(List(tpeCopypaste), exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))) = toolBox.parseExpr(output.toString())
+ toolBox.eval(Apply(reify, List(reifee)))
+ val Block(List(tpeCopypaste), exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))) = toolBox.parse(output.toString())
output.reset()
- toolBox.runExpr(Block(stats, expr))
+ toolBox.eval(Block(stats, expr))
stdout.println(output.toString)
} \ No newline at end of file
diff --git a/test/files/run/reify_getter.scala b/test/files/run/reify_getter.scala
index 26767603a0..cb04ddffde 100644
--- a/test/files/run/reify_getter.scala
+++ b/test/files/run/reify_getter.scala
@@ -13,6 +13,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala b/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala
index 8ea92c511b..76f935ecd2 100644
--- a/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala
+++ b/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala
index 7ff4f84de0..e7c5cb71c1 100644
--- a/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala
@@ -11,6 +11,6 @@ object Test extends App {
val code = reify{outer.eval.eval}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala
index 7f1f9d8478..770fcccd15 100644
--- a/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala
@@ -16,6 +16,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala
index 65e0931b6e..32e7e9003b 100644
--- a/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_nested_inner_refers_to_global.scala b/test/files/run/reify_nested_inner_refers_to_global.scala
index f45c1daed9..877222f5bf 100644
--- a/test/files/run/reify_nested_inner_refers_to_global.scala
+++ b/test/files/run/reify_nested_inner_refers_to_global.scala
@@ -12,6 +12,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_nested_inner_refers_to_local.scala b/test/files/run/reify_nested_inner_refers_to_local.scala
index 4a3d8bb02b..703474e07e 100644
--- a/test/files/run/reify_nested_inner_refers_to_local.scala
+++ b/test/files/run/reify_nested_inner_refers_to_local.scala
@@ -12,6 +12,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_nested_outer_refers_to_global.scala b/test/files/run/reify_nested_outer_refers_to_global.scala
index b628975e59..e40c569ce6 100644
--- a/test/files/run/reify_nested_outer_refers_to_global.scala
+++ b/test/files/run/reify_nested_outer_refers_to_global.scala
@@ -14,6 +14,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_nested_outer_refers_to_local.scala b/test/files/run/reify_nested_outer_refers_to_local.scala
index 80564fa9a2..12147c51da 100644
--- a/test/files/run/reify_nested_outer_refers_to_local.scala
+++ b/test/files/run/reify_nested_outer_refers_to_local.scala
@@ -14,6 +14,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_45.scala b/test/files/run/reify_newimpl_45.scala
index cbae0839b2..2a6c68d441 100644
--- a/test/files/run/reify_newimpl_45.scala
+++ b/test/files/run/reify_newimpl_45.scala
@@ -9,7 +9,7 @@ object Test extends App {
println(code.tree.freeTypes)
val T = code.tree.freeTypes(0)
val tree = code.tree.substituteSymbols(List(T), List(definitions.StringClass))
- cm.mkToolBox().runExpr(tree)
+ cm.mkToolBox().eval(tree)
}
new C[String]
diff --git a/test/files/run/reify_printf.scala b/test/files/run/reify_printf.scala
index 07e99781e3..272856b962 100644
--- a/test/files/run/reify_printf.scala
+++ b/test/files/run/reify_printf.scala
@@ -14,7 +14,7 @@ object Test extends App {
val toolbox = cm.mkToolBox()
val tree = tree_printf(reify("hello %s").tree, reify("world").tree)
- val evaluated = toolbox.runExpr(tree)
+ val evaluated = toolbox.eval(tree)
assert(output.toString() == "hello world", output.toString() +" == hello world")
/*
diff --git a/test/files/run/reify_typerefs_1a.scala b/test/files/run/reify_typerefs_1a.scala
index 53033e210c..2e961f171d 100644
--- a/test/files/run/reify_typerefs_1a.scala
+++ b/test/files/run/reify_typerefs_1a.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_1b.scala b/test/files/run/reify_typerefs_1b.scala
index 12604454ed..88bb864820 100644
--- a/test/files/run/reify_typerefs_1b.scala
+++ b/test/files/run/reify_typerefs_1b.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_2a.scala b/test/files/run/reify_typerefs_2a.scala
index ffc3dfc942..3a1db1d80f 100644
--- a/test/files/run/reify_typerefs_2a.scala
+++ b/test/files/run/reify_typerefs_2a.scala
@@ -15,6 +15,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_2b.scala b/test/files/run/reify_typerefs_2b.scala
index f5d1633d79..50082aa8d2 100644
--- a/test/files/run/reify_typerefs_2b.scala
+++ b/test/files/run/reify_typerefs_2b.scala
@@ -15,6 +15,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_3a.scala b/test/files/run/reify_typerefs_3a.scala
index 67b2c2d8aa..682d6f01ac 100644
--- a/test/files/run/reify_typerefs_3a.scala
+++ b/test/files/run/reify_typerefs_3a.scala
@@ -15,6 +15,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_3b.scala b/test/files/run/reify_typerefs_3b.scala
index 41a0a667e2..c85072f55f 100644
--- a/test/files/run/reify_typerefs_3b.scala
+++ b/test/files/run/reify_typerefs_3b.scala
@@ -15,6 +15,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5229_2.scala b/test/files/run/t5229_2.scala
index 75d7204911..f059b09772 100644
--- a/test/files/run/t5229_2.scala
+++ b/test/files/run/t5229_2.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5230.scala b/test/files/run/t5230.scala
index 5cd67766b4..f6a7817c0b 100644
--- a/test/files/run/t5230.scala
+++ b/test/files/run/t5230.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5266_1.scala b/test/files/run/t5266_1.scala
index ee7ea6d335..7bf73ac988 100644
--- a/test/files/run/t5266_1.scala
+++ b/test/files/run/t5266_1.scala
@@ -10,6 +10,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5266_2.scala b/test/files/run/t5266_2.scala
index ca16f656ee..9b33910d00 100644
--- a/test/files/run/t5266_2.scala
+++ b/test/files/run/t5266_2.scala
@@ -11,6 +11,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5334_1.scala b/test/files/run/t5334_1.scala
index 2b6418990a..3aeb7e4437 100644
--- a/test/files/run/t5334_1.scala
+++ b/test/files/run/t5334_1.scala
@@ -11,5 +11,5 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- println(toolbox.runExpr(code.tree))
+ println(toolbox.eval(code.tree))
} \ No newline at end of file
diff --git a/test/files/run/t5334_2.scala b/test/files/run/t5334_2.scala
index 815f78f951..64ee1e0acd 100644
--- a/test/files/run/t5334_2.scala
+++ b/test/files/run/t5334_2.scala
@@ -11,5 +11,5 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- println(toolbox.runExpr(code.tree))
+ println(toolbox.eval(code.tree))
} \ No newline at end of file
diff --git a/test/files/run/t6199-toolbox.scala b/test/files/run/t6199-toolbox.scala
index 14670f8e21..89015f5878 100644
--- a/test/files/run/t6199-toolbox.scala
+++ b/test/files/run/t6199-toolbox.scala
@@ -4,5 +4,5 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val tb = cm.mkToolBox()
- println(tb.runExpr(Literal(Constant(()))))
+ println(tb.eval(Literal(Constant(()))))
} \ No newline at end of file
diff --git a/test/files/run/toolbox_console_reporter.scala b/test/files/run/toolbox_console_reporter.scala
index c5b788550e..a57dea38a8 100644
--- a/test/files/run/toolbox_console_reporter.scala
+++ b/test/files/run/toolbox_console_reporter.scala
@@ -5,7 +5,7 @@ object Test extends App {
// todo. and isn't affected by Console.setOut employed by partest to intercept output
//val toolbox = mkToolBox(frontEnd = mkConsoleFrontEnd(), options = "-deprecation")
- //toolbox.runExpr(reify{
+ //toolbox.eval(reify{
// object Utils {
// @deprecated("test", "2.10.0")
// def foo { println("hello") }
diff --git a/test/files/run/toolbox_default_reporter_is_silent.scala b/test/files/run/toolbox_default_reporter_is_silent.scala
index 5f3269b6fa..4bd7a646b0 100644
--- a/test/files/run/toolbox_default_reporter_is_silent.scala
+++ b/test/files/run/toolbox_default_reporter_is_silent.scala
@@ -5,7 +5,7 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val toolbox = cm.mkToolBox()
- toolbox.runExpr(reify{
+ toolbox.eval(reify{
object Utils {
@deprecated("test", "2.10.0")
def foo { println("hello") }
diff --git a/test/files/run/toolbox_silent_reporter.scala b/test/files/run/toolbox_silent_reporter.scala
index 915734e6ad..15f559d605 100644
--- a/test/files/run/toolbox_silent_reporter.scala
+++ b/test/files/run/toolbox_silent_reporter.scala
@@ -5,7 +5,7 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val toolbox = cm.mkToolBox(options = "-deprecation")
- toolbox.runExpr(reify{
+ toolbox.eval(reify{
object Utils {
@deprecated("test", "2.10.0")
def foo { println("hello") }
diff --git a/test/pending/neg/reify_packed.scala b/test/pending/neg/reify_packed.scala
index 2004e031d5..7bdaa41915 100644
--- a/test/pending/neg/reify_packed.scala
+++ b/test/pending/neg/reify_packed.scala
@@ -11,5 +11,5 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- println(toolbox.runExpr(code.tree))
+ println(toolbox.eval(code.tree))
} \ No newline at end of file
diff --git a/test/pending/run/macro-reify-tagless-b/Test_2.scala b/test/pending/run/macro-reify-tagless-b/Test_2.scala
index 4649963d05..ebd35ffe47 100644
--- a/test/pending/run/macro-reify-tagless-b/Test_2.scala
+++ b/test/pending/run/macro-reify-tagless-b/Test_2.scala
@@ -9,5 +9,5 @@ object Test extends App {
val rhs = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant("hello world"))))
val list = ValDef(NoMods, newTermName("list"), tpt, rhs)
val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name))))
- println(cm.mkToolBox().runExpr(tree))
+ println(cm.mkToolBox().eval(tree))
}
diff --git a/test/pending/run/reify_closure2b.scala b/test/pending/run/reify_closure2b.scala
index 565bb03b2f..0f126c8c91 100644
--- a/test/pending/run/reify_closure2b.scala
+++ b/test/pending/run/reify_closure2b.scala
@@ -12,7 +12,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(new Foo(y).fun.tree)
+ val dyn = toolbox.eval(new Foo(y).fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/pending/run/reify_closure3b.scala b/test/pending/run/reify_closure3b.scala
index 0d806b148b..54ac52ba0b 100644
--- a/test/pending/run/reify_closure3b.scala
+++ b/test/pending/run/reify_closure3b.scala
@@ -14,7 +14,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(new Foo(y).fun.tree)
+ val dyn = toolbox.eval(new Foo(y).fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/pending/run/reify_closure4b.scala b/test/pending/run/reify_closure4b.scala
index 1a349de072..34f707e092 100644
--- a/test/pending/run/reify_closure4b.scala
+++ b/test/pending/run/reify_closure4b.scala
@@ -14,7 +14,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(new Foo(y).fun.tree)
+ val dyn = toolbox.eval(new Foo(y).fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/pending/run/reify_closure5b.scala b/test/pending/run/reify_closure5b.scala
index 3e5e1bd328..0e506bf7b5 100644
--- a/test/pending/run/reify_closure5b.scala
+++ b/test/pending/run/reify_closure5b.scala
@@ -12,7 +12,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(new Foo(ys).fun.tree)
+ val dyn = toolbox.eval(new Foo(ys).fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/pending/run/reify_closure9a.scala b/test/pending/run/reify_closure9a.scala
index dddfa3f6c2..f39ff1e2f3 100644
--- a/test/pending/run/reify_closure9a.scala
+++ b/test/pending/run/reify_closure9a.scala
@@ -10,7 +10,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(new Foo(y).fun.tree)
+ val dyn = toolbox.eval(new Foo(y).fun.tree)
dyn.asInstanceOf[Int]
}
diff --git a/test/pending/run/reify_closure9b.scala b/test/pending/run/reify_closure9b.scala
index df9db9b806..a6920b4e02 100644
--- a/test/pending/run/reify_closure9b.scala
+++ b/test/pending/run/reify_closure9b.scala
@@ -10,7 +10,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(new Foo(y).fun.tree)
+ val dyn = toolbox.eval(new Foo(y).fun.tree)
dyn.asInstanceOf[Int]
}
diff --git a/test/pending/run/reify_closures11.scala b/test/pending/run/reify_closures11.scala
index 4c21033cbc..9156208b40 100644
--- a/test/pending/run/reify_closures11.scala
+++ b/test/pending/run/reify_closures11.scala
@@ -10,7 +10,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun().tree)
+ val dyn = toolbox.eval(fun().tree)
val foo = dyn.asInstanceOf[Int]
println(foo)
} \ No newline at end of file
diff --git a/test/pending/run/reify_newimpl_09c.scala b/test/pending/run/reify_newimpl_09c.scala
index e2f4a4923a..6bde36328e 100644
--- a/test/pending/run/reify_newimpl_09c.scala
+++ b/test/pending/run/reify_newimpl_09c.scala
@@ -14,7 +14,7 @@ object Test extends App {
val code = foo[Int]
println(code.tree.freeTypes)
val W = code.tree.freeTypes(2)
- cm.mkToolBox().runExpr(code.tree, Map(W -> definitions.IntTpe))
+ cm.mkToolBox().eval(code.tree, Map(W -> definitions.IntTpe))
println(code.eval)
}
} \ No newline at end of file
diff --git a/test/pending/run/reify_newimpl_46.scala b/test/pending/run/reify_newimpl_46.scala
index 239c53953b..d063be0486 100644
--- a/test/pending/run/reify_newimpl_46.scala
+++ b/test/pending/run/reify_newimpl_46.scala
@@ -8,7 +8,7 @@ object Test extends App {
val code = reify{val x: T[String] = null; println("ima worx"); x}.tree
println(code.freeTypes)
val T = code.freeTypes(0)
- cm.mkToolBox().runExpr(code, Map(T -> definitions.ListClass.asType))
+ cm.mkToolBox().eval(code, Map(T -> definitions.ListClass.asType))
}
new C[List]
diff --git a/test/pending/run/reify_newimpl_53.scala b/test/pending/run/reify_newimpl_53.scala
index a73a0b94cb..54fa4bec1d 100644
--- a/test/pending/run/reify_newimpl_53.scala
+++ b/test/pending/run/reify_newimpl_53.scala
@@ -11,7 +11,7 @@ object Test extends App {
}.tree
println(code.freeTypes)
val T = code.freeTypes(0)
- cm.mkToolBox().runExpr(code, Map(T -> definitions.StringClass.asType))
+ cm.mkToolBox().eval(code, Map(T -> definitions.StringClass.asType))
}
new C[String]