summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/ScriptRunner.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-09-01 02:31:55 +0000
committerPaul Phillips <paulp@improving.org>2011-09-01 02:31:55 +0000
commit9954de923ef0c87fcffacabe3e18c31bf7f69f5e (patch)
tree8ab55c2424b823771ee55b43c67581f86310a981 /src/compiler/scala/tools/nsc/ScriptRunner.scala
parent0377cad8c6a26be5b6dd59323dd171634400005a (diff)
downloadscala-9954de923ef0c87fcffacabe3e18c31bf7f69f5e.tar.gz
scala-9954de923ef0c87fcffacabe3e18c31bf7f69f5e.tar.bz2
scala-9954de923ef0c87fcffacabe3e18c31bf7f69f5e.zip
Made it possible to supply a custom Global to t...
Made it possible to supply a custom Global to the core scala runners. The absence of "Global pluggability", combined with the fact that most of the functionality in Global is unnecessarily rigid due to the phases being implemented as objects, means that it has been close to impossible to do interesting compiler development in a way which doesn't require modifying the scalac source tree. This then leaves you continually subject to punishment by code drift as the various places you were forced to modify change out from under you. This is somewhat less true now, thanks to new option: -Yglobal-class The primary wielders of Global (fsc/scala/scalac) now instantiate the compiler via a (Settings, Reporter) => Global factory method in the Global companion. If -Yglobal-class was given, that class (which must have a (Settings, Reporter) constructor) will be instantiated if possible, falling back on the standard one. See test/files/pos/CustomGlobal.scala for a working example. (It's not in run because I would have to be able to give partest a different set of flags for successive compiles in the same test.) Review by odersky.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ScriptRunner.scala')
-rw-r--r--src/compiler/scala/tools/nsc/ScriptRunner.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ScriptRunner.scala b/src/compiler/scala/tools/nsc/ScriptRunner.scala
index 3ec5b2f044..dd9bca4b7b 100644
--- a/src/compiler/scala/tools/nsc/ScriptRunner.scala
+++ b/src/compiler/scala/tools/nsc/ScriptRunner.scala
@@ -84,7 +84,7 @@ class ScriptRunner extends HasCompileSocket {
}
protected def newGlobal(settings: Settings, reporter: Reporter) =
- new Global(settings, reporter)
+ Global(settings, reporter)
/** Compile a script and then run the specified closure with
* a classpath for the compiled script.