summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools
diff options
context:
space:
mode:
authorEugene Vigdorchik <eugenevigdorchik@epfl.ch>2011-02-23 15:02:47 +0000
committerEugene Vigdorchik <eugenevigdorchik@epfl.ch>2011-02-23 15:02:47 +0000
commit82909349e3a65f864da7f6bea4de2ddd584ae884 (patch)
tree6e974322a0ec17dde448d780b86700e0cc8cfd03 /src/compiler/scala/tools
parent6ae78736589639f54d7987883cf3794cf69f6ac4 (diff)
downloadscala-82909349e3a65f864da7f6bea4de2ddd584ae884.tar.gz
scala-82909349e3a65f864da7f6bea4de2ddd584ae884.tar.bz2
scala-82909349e3a65f864da7f6bea4de2ddd584ae884.zip
Partial revert of r24325; tryToSetFromPropertyV...
Partial revert of r24325; tryToSetFromPropertyValue is used by Eclipse.
Diffstat (limited to 'src/compiler/scala/tools')
-rw-r--r--src/compiler/scala/tools/nsc/settings/AbsSettings.scala7
-rw-r--r--src/compiler/scala/tools/nsc/settings/MutableSettings.scala5
2 files changed, 11 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/settings/AbsSettings.scala b/src/compiler/scala/tools/nsc/settings/AbsSettings.scala
index 0cc3be6e64..59794764fe 100644
--- a/src/compiler/scala/tools/nsc/settings/AbsSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/AbsSettings.scala
@@ -106,6 +106,11 @@ trait AbsSettings {
protected[nsc] def tryToSetColon(args: List[String]): Option[ResultOfTryToSet] =
errorAndValue("'%s' does not accept multiple arguments" format name, None)
+ /** Attempt to set from a properties file style property value.
+ * Currently used by Eclipse SDT only.
+ */
+ def tryToSetFromPropertyValue(s: String): Unit = tryToSet(s :: Nil)
+
/** These categorizations are so the help output shows -X and -P among
* the standard options and -Y among the advanced options.
*/
@@ -131,4 +136,4 @@ trait AbsSettings {
trait InternalSetting extends AbsSetting {
override def isInternalOnly = true
}
-} \ No newline at end of file
+}
diff --git a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
index 11b4a2510c..65874cb5bb 100644
--- a/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
+++ b/src/compiler/scala/tools/nsc/settings/MutableSettings.scala
@@ -447,6 +447,9 @@ class MutableSettings(val errorFn: String => Unit) extends AbsSettings with Scal
def tryToSet(args: List[String]) = { value = true ; Some(args) }
def unparse: List[String] = if (value) List(name) else Nil
+ override def tryToSetFromPropertyValue(s : String) {
+ value = s.equalsIgnoreCase("true")
+ }
}
/** A special setting for accumulating arguments like -Dfoo=bar. */
@@ -544,6 +547,7 @@ class MutableSettings(val errorFn: String => Unit) extends AbsSettings with Scal
Some(rest)
}
override def tryToSetColon(args: List[String]) = tryToSet(args)
+ override def tryToSetFromPropertyValue(s: String) = tryToSet(s.trim.split(" +").toList)
def unparse: List[String] = value map { name + ":" + _ }
withHelpSyntax(name + ":<" + arg + ">")
@@ -573,6 +577,7 @@ class MutableSettings(val errorFn: String => Unit) extends AbsSettings with Scal
}
def unparse: List[String] =
if (value == default) Nil else List(name + ":" + value)
+ override def tryToSetFromPropertyValue(s: String) = tryToSetColon(s::Nil)
withHelpSyntax(name + ":<" + helpArg + ">")
}