summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/REPL.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-01-31 15:08:22 +0000
committerMartin Odersky <odersky@gmail.com>2011-01-31 15:08:22 +0000
commit6de1404fd3821509175c76c7c109d946332b4db1 (patch)
tree42a8c6bdf81021346c04e3c4faff5f7bb8374e30 /src/compiler/scala/tools/nsc/interactive/REPL.scala
parent2f1759cebcba51509f9d66ddbe1b8248f206e4a4 (diff)
downloadscala-6de1404fd3821509175c76c7c109d946332b4db1.tar.gz
scala-6de1404fd3821509175c76c7c109d946332b4db1.tar.bz2
scala-6de1404fd3821509175c76c7c109d946332b4db1.zip
Fixed askStructure hangs.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interactive/REPL.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interactive/REPL.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/REPL.scala b/src/compiler/scala/tools/nsc/interactive/REPL.scala
index 4e5d5668cb..edc195d1d7 100644
--- a/src/compiler/scala/tools/nsc/interactive/REPL.scala
+++ b/src/compiler/scala/tools/nsc/interactive/REPL.scala
@@ -84,6 +84,7 @@ object REPL {
val typeatResult = new Response[comp.Tree]
val completeResult = new Response[List[comp.Member]]
val typedResult = new Response[comp.Tree]
+ val structureResult = new Response[List[comp.Symbol]]
def makePos(file: String, off1: String, off2: String) = {
val source = toSourceFile(file)
@@ -101,6 +102,10 @@ object REPL {
comp.askType(toSourceFile(file), true, typedResult)
show(typedResult)
}
+ def doStructure(file: String) {
+ comp.askStructure(toSourceFile(file), false, structureResult)
+ show(structureResult)
+ }
loop { line =>
(line split " ").toList match {
@@ -126,6 +131,8 @@ object REPL {
case List("quit") =>
comp.askShutdown()
sys.exit(1)
+ case List("structure", file) =>
+ doStructure(file)
case _ =>
println("unrecongized command")
}