diff options
author | Paul Phillips <paulp@improving.org> | 2011-02-04 04:31:38 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-02-04 04:31:38 +0000 |
commit | 4d862deb3a8ed81f9d084d1be41b617f074a2af5 (patch) | |
tree | a18f60f1333e7b76d27dd8e0a72e54d76c8272d6 /src/compiler/scala/tools/nsc/interpreter/ILoop.scala | |
parent | f61020bb96c06f8da1f57e89703b233d01ec254c (diff) | |
download | scala-4d862deb3a8ed81f9d084d1be41b617f074a2af5.tar.gz scala-4d862deb3a8ed81f9d084d1be41b617f074a2af5.tar.bz2 scala-4d862deb3a8ed81f9d084d1be41b617f074a2af5.zip |
Ignore anonymous and synthetic classes when ass...
Ignore anonymous and synthetic classes when assessing the "runtime type"
of an object. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/ILoop.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/interpreter/ILoop.scala | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala index 5dfd5da76c..e0a49554ed 100644 --- a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala +++ b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala @@ -111,31 +111,33 @@ class ILoop(in0: Option[BufferedReader], protected val out: PrintWriter) } } + class ILoopInterpreter extends IMain(settings, out) { + override lazy val formatting = new Formatting { + def prompt = ILoop.this.prompt + } + override protected def createLineManager() = new Line.Manager { + override def onRunaway(line: Line[_]): Unit = { + val template = """ + |// She's gone rogue, captain! Have to take her out! + |// Calling Thread.stop on runaway %s with offending code: + |// scala> %s""".stripMargin + + println(template.format(line.thread, line.code)) + // XXX no way to suppress the deprecation warning + line.thread.stop() + in.redrawLine() + } + } + override protected def parentClassLoader = + settings.explicitParentLoader.getOrElse( classOf[ILoop].getClassLoader ) + } + /** Create a new interpreter. */ def createInterpreter() { if (addedClasspath != "") settings.classpath append addedClasspath - intp = new IMain(settings, out) { - override lazy val formatting = new Formatting { - def prompt = ILoop.this.prompt - } - override protected def createLineManager() = new Line.Manager { - override def onRunaway(line: Line[_]): Unit = { - val template = """ - |// She's gone rogue, captain! Have to take her out! - |// Calling Thread.stop on runaway %s with offending code: - |// scala> %s""".stripMargin - - println(template.format(line.thread, line.code)) - // XXX no way to suppress the deprecation warning - line.thread.stop() - in.redrawLine() - } - } - override protected def parentClassLoader = - settings.explicitParentLoader.getOrElse( classOf[ILoop].getClassLoader ) - } + intp = new ILoopInterpreter intp.setContextClassLoader() installSigIntHandler() } |