From caee04079fb8ed40a1458cf24649fad9d80a85c1 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 7 Apr 2011 17:43:41 +0000 Subject: Made power mode more configurable. long-term configuration answer, but what I have any chance of doing before 2.9 ships. // file to interpret when entering power mode instead of default -Dscala.repl.power.initcode=/path/to/file // file holding banner to display instead of default -Dscala.repl.power.banner=/path/to/file No review. --- .../scala/tools/nsc/interpreter/package.scala | 23 ++-------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/compiler/scala/tools/nsc/interpreter/package.scala') diff --git a/src/compiler/scala/tools/nsc/interpreter/package.scala b/src/compiler/scala/tools/nsc/interpreter/package.scala index 322224ed36..aaf07343cb 100644 --- a/src/compiler/scala/tools/nsc/interpreter/package.scala +++ b/src/compiler/scala/tools/nsc/interpreter/package.scala @@ -22,39 +22,20 @@ package scala.tools.nsc * InteractiveReader contains { history: History, completion: Completion } * IMain contains { global: Global } */ -package object interpreter { +package object interpreter extends ReplConfig { + type JFile = java.io.File type JClass = java.lang.Class[_] type JList[T] = java.util.List[T] type JCollection[T] = java.util.Collection[T] type InputStream = java.io.InputStream type OutputStream = java.io.OutputStream - private[nsc] val JLineDebug = "scala.tools.jline.internal.Log.debug" - private[nsc] val JLineTrace = "scala.tools.jline.internal.Log.trace" - - private[nsc] val DebugProperty = "scala.repl.debug" - private[nsc] val TraceProperty = "scala.repl.trace" - private[nsc] val PowerProperty = "scala.repl.power" - private[nsc] var isReplDebug = sys.props contains DebugProperty // Also set by -Yrepl-debug - private[nsc] var isReplPower = sys.props contains PowerProperty - private[nsc] implicit def enrichClass[T](clazz: Class[T]) = new RichClass[T](clazz) private[interpreter] implicit def javaCharSeqCollectionToScala(xs: JCollection[_ <: CharSequence]): List[String] = { import collection.JavaConverters._ xs.asScala.toList map ("" + _) } - /** Debug output */ - private[nsc] def repldbg(msg: String) = if (isReplDebug) Console println msg - - /** Tracing */ - private[nsc] def tracing[T](msg: String)(x: T): T = { - if (isReplDebug) - println("(" + msg + ") " + x) - - x - } - // Longest common prefix def longestCommonPrefix(xs: List[String]): String = { if (xs.isEmpty || xs.contains("")) "" -- cgit v1.2.3