diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/interactive/REPL.scala | 7 |
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") } |