summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/Interpreter.scala2
-rw-r--r--src/compiler/scala/tools/nsc/InterpreterSettings.scala22
2 files changed, 20 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala
index d34c4a8640..48cc5bc61b 100644
--- a/src/compiler/scala/tools/nsc/Interpreter.scala
+++ b/src/compiler/scala/tools/nsc/Interpreter.scala
@@ -102,7 +102,7 @@ class Interpreter(val settings: Settings, out: PrintWriter)
}
/** interpreter settings */
- lazy val isettings = new InterpreterSettings
+ lazy val isettings = new InterpreterSettings(this)
object reporter extends ConsoleReporter(settings, null, out) {
override def printMessage(msg: String) {
diff --git a/src/compiler/scala/tools/nsc/InterpreterSettings.scala b/src/compiler/scala/tools/nsc/InterpreterSettings.scala
index 8675e3d8bd..e274294082 100644
--- a/src/compiler/scala/tools/nsc/InterpreterSettings.scala
+++ b/src/compiler/scala/tools/nsc/InterpreterSettings.scala
@@ -11,7 +11,7 @@ package scala.tools.nsc
* @version 1.0
* @author Lex Spoon, 2007/3/24
**/
-class InterpreterSettings {
+class InterpreterSettings(repl: Interpreter) {
/** A list of paths where :load should look */
var loadPath = List(".")
@@ -22,6 +22,14 @@ class InterpreterSettings {
*/
var maxPrintString = 2400
+ def deprecation_=(x: Boolean) = {
+ val old = repl.settings.deprecation.value
+ repl.settings.deprecation.value = x
+ if (!old && x) println("Enabled -deprecation output.")
+ else if (old && !x) println("Disabled -deprecation output.")
+ }
+ def deprecation: Boolean = repl.settings.deprecation.value
+
override def toString =
"InterpreterSettings {\n" +
// " loadPath = " + loadPath + "\n" +
@@ -50,7 +58,7 @@ package scala.tools.nsc
* @version 1.0
* @author Lex Spoon, 2007/3/24
**/
-class InterpreterSettings {
+class InterpreterSettings(repl: Interpreter) {
/** A list of paths where :load should look */
var loadPath = List(".")
@@ -59,7 +67,15 @@ class InterpreterSettings {
* more than this number of characters, then the printout is
* truncated.
*/
- var maxPrintString = 390
+ var maxPrintString = 2400
+
+ def deprecation_=(x: Boolean) = {
+ val old = repl.settings.deprecation.value
+ repl.settings.deprecation.value = x
+ if (!old && x) println("Enabled -deprecation output.")
+ else if (old && !x) println("Disabled -deprecation output.")
+ }
+ def deprecation: Boolean = repl.settings.deprecation.value
override def toString =
"InterpreterSettings {\n" +