summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiles Sabin <miles@milessabin.com>2009-03-13 00:13:23 +0000
committerMiles Sabin <miles@milessabin.com>2009-03-13 00:13:23 +0000
commitca9431e11c1d72de95ef76cc04474725eae34b0e (patch)
treeaf96f2aaa07eabd677567f733b0588721dc24aa8 /src
parentb4e3d06662a6e4b3aa28692f2d0cdfe6f7cd1070 (diff)
downloadscala-ca9431e11c1d72de95ef76cc04474725eae34b0e.tar.gz
scala-ca9431e11c1d72de95ef76cc04474725eae34b0e.tar.bz2
scala-ca9431e11c1d72de95ef76cc04474725eae34b0e.zip
Minor changes to support the Eclipse plugin.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index 662ecedf1a..08ea8932ba 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -215,6 +215,7 @@ object Settings
def isDefault: Boolean = !setByUser
def value: T = v
def value_=(arg: T) = { setByUser = true ; v = arg }
+ val choices : List[T] = Nil
}
// The Setting companion object holds all the factory methods
@@ -275,6 +276,13 @@ object Settings
private[Settings] def tryToSetProperty(args: List[String]): Option[List[String]] =
errorAndValue("'" + name + "' does not accept property style arguments", None)
+ /**
+ * Attempt to set from a properties file style property value.
+ */
+ def tryToSetFromPropertyValue(s : String) {
+ tryToSet(s :: Nil)
+ }
+
/** The syntax defining this setting in a help string */
private var _helpSyntax = name
def helpSyntax: String = _helpSyntax
@@ -386,6 +394,9 @@ object Settings
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 setting represented by a string, (`default' unless set) */
@@ -435,7 +446,7 @@ object Settings
class ChoiceSetting private[Settings](
val name: String,
val descr: String,
- val choices: List[String],
+ override val choices: List[String],
val default: String)
extends Setting(descr + choices.mkString(" (", ",", ")"))
{