summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2007-02-19 14:45:51 +0000
committermihaylov <mihaylov@epfl.ch>2007-02-19 14:45:51 +0000
commit7b006dc22e3df0ba0ddbbb74febbd61ff7cd0917 (patch)
tree8a5760c8c6491cc7a7578f5469938ebb13189c4b /src
parent0647a263beeeb50a09d3d88bb93793f0ee59611f (diff)
downloadscala-7b006dc22e3df0ba0ddbbb74febbd61ff7cd0917.tar.gz
scala-7b006dc22e3df0ba0ddbbb74febbd61ff7cd0917.tar.bz2
scala-7b006dc22e3df0ba0ddbbb74febbd61ff7cd0917.zip
Fixed bug #953
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/CompileServer.scala2
-rw-r--r--src/compiler/scala/tools/nsc/CompilerCommand.scala7
-rw-r--r--src/compiler/scala/tools/nsc/InterpreterCommand.scala4
-rw-r--r--src/compiler/scala/tools/nsc/Main.scala7
-rw-r--r--src/compiler/scala/tools/nsc/MainTokenMetric.scala5
5 files changed, 13 insertions, 12 deletions
diff --git a/src/compiler/scala/tools/nsc/CompileServer.scala b/src/compiler/scala/tools/nsc/CompileServer.scala
index 24d4b17bd9..198d473795 100644
--- a/src/compiler/scala/tools/nsc/CompileServer.scala
+++ b/src/compiler/scala/tools/nsc/CompileServer.scala
@@ -93,7 +93,7 @@ object CompileServer extends SocketServer {
def error(msg: String): unit =
reporter.error(/*new Position*/ FakePos("fsc"),
msg + "\n fsc -help gives more information")
- val command = new CompilerCommand(args, error, false) {
+ val command = new CompilerCommand(args, new Settings(error), error, false) {
override val cmdName = "fsc"
settings.disable(settings.prompt)
settings.disable(settings.resident)
diff --git a/src/compiler/scala/tools/nsc/CompilerCommand.scala b/src/compiler/scala/tools/nsc/CompilerCommand.scala
index d5bd523efa..081af5b921 100644
--- a/src/compiler/scala/tools/nsc/CompilerCommand.scala
+++ b/src/compiler/scala/tools/nsc/CompilerCommand.scala
@@ -10,15 +10,14 @@ package scala.tools.nsc
import compat.StringBuilder
/** A class representing command line info for scalac */
-class CompilerCommand(arguments: List[String], error: String => unit, interactive: boolean) {
+class CompilerCommand(arguments: List[String], val settings: Settings,
+ error: String => unit, interactive: boolean) {
+
private var fs: List[String] = List()
/** All files to compile */
def files: List[String] = fs.reverse
- /** The applicable settings */
- val settings: Settings = new Settings(error)
-
/** The name of the command */
val cmdName = "scalac"
diff --git a/src/compiler/scala/tools/nsc/InterpreterCommand.scala b/src/compiler/scala/tools/nsc/InterpreterCommand.scala
index 4d20b4ab76..308fe19860 100644
--- a/src/compiler/scala/tools/nsc/InterpreterCommand.scala
+++ b/src/compiler/scala/tools/nsc/InterpreterCommand.scala
@@ -2,13 +2,13 @@
* Copyright 2005-2006 LAMP/EPFL
* @author Martin Odersky
*/
-// $Id: $
+// $Id$
package scala.tools.nsc
/** a command line for the interpreter */
class InterpreterCommand(arguments: List[String], error: String => unit)
-extends CompilerCommand(arguments, error, false) {
+extends CompilerCommand(arguments, new Settings(error), error, false) {
override val cmdName = "scala"
override val fileEnding = ".scalaint"
}
diff --git a/src/compiler/scala/tools/nsc/Main.scala b/src/compiler/scala/tools/nsc/Main.scala
index 5c4c52e2f3..82a0026c24 100644
--- a/src/compiler/scala/tools/nsc/Main.scala
+++ b/src/compiler/scala/tools/nsc/Main.scala
@@ -33,13 +33,14 @@ object Main extends AnyRef with EvalLoop {
def resident(compiler: Global): unit =
loop { line =>
val args = List.fromString(line, ' ')
- val command = new CompilerCommand(args, error, true)
+ val command = new CompilerCommand(args, new Settings(error), error, true)
(new compiler.Run) compile command.files
}
def process(args: Array[String]): unit = {
- val command = new CompilerCommand(List.fromArray(args), error, false)
- reporter = new ConsoleReporter(command.settings)
+ val settings = new Settings(error)
+ reporter = new ConsoleReporter(settings)
+ val command = new CompilerCommand(List.fromArray(args), settings, error, false)
if (command.settings.version.value)
reporter.info(null, versionMsg, true)
else if (command.settings.help.value)
diff --git a/src/compiler/scala/tools/nsc/MainTokenMetric.scala b/src/compiler/scala/tools/nsc/MainTokenMetric.scala
index 798f43140b..e1a0e6f906 100644
--- a/src/compiler/scala/tools/nsc/MainTokenMetric.scala
+++ b/src/compiler/scala/tools/nsc/MainTokenMetric.scala
@@ -41,8 +41,9 @@ object MainTokenMetric {
}
def process(args: Array[String]): unit = {
- val command = new CompilerCommand(List.fromArray(args), error, false)
- reporter = new ConsoleReporter(command.settings)
+ val settings = new Settings(error)
+ reporter = new ConsoleReporter(settings)
+ val command = new CompilerCommand(List.fromArray(args), settings, error, false)
try {
val compiler = new Global(command.settings, reporter)
tokenMetric(compiler, command.files)