summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/common/settings/MutableSettings.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-05-16 21:08:55 +0000
committerPaul Phillips <paulp@improving.org>2011-05-16 21:08:55 +0000
commit9bab5cc04e90f2544710dcc5851c2a1fc9589f9e (patch)
treea6eb0c12064b9d4b4daf78e4953a8d976d91fc69 /src/compiler/scala/reflect/common/settings/MutableSettings.scala
parent806a524f9a3aedb850c604c7e2d0338b20459432 (diff)
downloadscala-9bab5cc04e90f2544710dcc5851c2a1fc9589f9e.tar.gz
scala-9bab5cc04e90f2544710dcc5851c2a1fc9589f9e.tar.bz2
scala-9bab5cc04e90f2544710dcc5851c2a1fc9589f9e.zip
Settings code into common.settings, no review.
Diffstat (limited to 'src/compiler/scala/reflect/common/settings/MutableSettings.scala')
-rw-r--r--src/compiler/scala/reflect/common/settings/MutableSettings.scala41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/compiler/scala/reflect/common/settings/MutableSettings.scala b/src/compiler/scala/reflect/common/settings/MutableSettings.scala
new file mode 100644
index 0000000000..dfde14bb37
--- /dev/null
+++ b/src/compiler/scala/reflect/common/settings/MutableSettings.scala
@@ -0,0 +1,41 @@
+/* NSC -- new Scala compiler
+ * Copyright 2005-2011 LAMP/EPFL
+ * @author Martin Odersky
+ */
+// $Id$
+
+package scala.reflect.common
+package settings
+
+/** A mutable Settings object.
+ */
+abstract class MutableSettings extends AbsSettings {
+
+ type Setting <: SettingValue
+
+ // basically this is a value which remembers if it's been modified
+ trait SettingValue extends AbsSettingValue {
+ protected var v: T
+ protected var setByUser: Boolean = false
+ def postSetHook(): Unit
+
+ def isDefault: Boolean = !setByUser
+ def value: T = v
+ def value_=(arg: T) = {
+ setByUser = true
+ v = arg
+ postSetHook()
+ }
+ }
+
+ def debug: SettingValue { type T = Boolean }
+ def YdepMethTpes: SettingValue { type T = Boolean }
+ def Ynotnull: SettingValue { type T = Boolean }
+ def explaintypes: SettingValue { type T = Boolean }
+ def verbose: SettingValue { type T = Boolean }
+ def uniqid: SettingValue { type T = Boolean }
+ def Xprintpos: SettingValue { type T = Boolean }
+ def printtypes: SettingValue { type T = Boolean }
+ def Yrecursion: SettingValue { type T = Int }
+ def maxClassfileName: SettingValue { type T = Int }
+} \ No newline at end of file