summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interpreter/IMain.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2012-12-04 01:39:46 -0800
committerSom Snytt <som.snytt@gmail.com>2012-12-06 15:09:32 -0800
commit1fa4ad083d7dc55ce498389d935b38c5b974b793 (patch)
treeab5f3501dd1081f88d0cec8634139b96e14b1bd1 /src/compiler/scala/tools/nsc/interpreter/IMain.scala
parent81e68f9abdbb77b8188375aad6568d4eac51d248 (diff)
downloadscala-1fa4ad083d7dc55ce498389d935b38c5b974b793.tar.gz
scala-1fa4ad083d7dc55ce498389d935b38c5b974b793.tar.bz2
scala-1fa4ad083d7dc55ce498389d935b38c5b974b793.zip
Restore unmangling but add -raw; massage options to support
tool args like -raw and combined -pv, and not pass through arbitrary options. If class arg fails, try it as a live term and use its enclosing class, to support "def m = 7; javap m". That might be more fun with filtering (to see only m). This saves having to know the line and iw's. There are no doubt more fun features for another rainy day. And it will rain again someday.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/IMain.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/IMain.scala8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/IMain.scala b/src/compiler/scala/tools/nsc/interpreter/IMain.scala
index 3f49e782b0..91e909b1f1 100644
--- a/src/compiler/scala/tools/nsc/interpreter/IMain.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/IMain.scala
@@ -312,6 +312,14 @@ class IMain(initialSettings: Settings, protected val out: JPrintWriter) extends
case _ => Some(flatPath(sym))
}
}
+ def translateEnclosingClass(n: String) = {
+ def enclosingClass(s: Symbol): Symbol =
+ if (s == NoSymbol || s.isClass) s else enclosingClass(s.owner)
+ enclosingClass(symbolOfTerm(n)) match {
+ case NoSymbol => None
+ case c => Some(flatPath(c))
+ }
+ }
private class TranslatingClassLoader(parent: ClassLoader) extends AbstractFileClassLoader(replOutput.dir, parent) {
/** Overridden here to try translating a simple name to the generated