diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2008-05-30 09:54:49 +0000 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2008-05-30 09:54:49 +0000 |
commit | b6281cd5a72fa31356020fab3929c6e0f4ad578f (patch) | |
tree | c42bf0c75c70d58423872115123ffcbebba81bc9 /src/compiler | |
parent | 97e20b1ff01bf106e08369071f9c48317443a6e4 (diff) | |
download | scala-b6281cd5a72fa31356020fab3929c6e0f4ad578f.tar.gz scala-b6281cd5a72fa31356020fab3929c6e0f4ad578f.tar.bz2 scala-b6281cd5a72fa31356020fab3929c6e0f4ad578f.zip |
treebrowser now shows annotations
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala index 69b691c7ae..94c19baa34 100644 --- a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala +++ b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala @@ -404,27 +404,27 @@ abstract class TreeBrowsers { case ClassDef(mods, name, tparams, impl) => { var children: List[Tree] = List() children = tparams ::: children - impl :: children + mods.annotations ::: impl :: children } case PackageDef(name, stats) => stats case ModuleDef(mods, name, impl) => - List(impl) + mods.annotations ::: List(impl) case ValDef(mods, name, tpe, rhs) => - List(tpe, rhs) + mods.annotations ::: List(tpe, rhs) case DefDef(mods, name, tparams, vparams, tpe, rhs) => { var children: List[Tree] = List() children = tparams ::: children children = List.flatten(vparams) ::: children - tpe :: rhs :: children + mods.annotations ::: tpe :: rhs :: children } case TypeDef(mods, name, tparams, rhs) => - rhs :: tparams // @M: was List(rhs, lobound) + mods.annotations ::: rhs :: tparams // @M: was List(rhs, lobound) case Import(expr, selectors) => { var children: List[Tree] = List(expr) @@ -570,7 +570,7 @@ abstract class TreeBrowsers { val s = t.symbol var att = "" - if (s ne null) { + if ((s ne null) && (s != NoSymbol)) { var str = flagsToString(s.flags) if (s.isStaticMember) str = str + " isStatic "; str @@ -684,8 +684,14 @@ abstract class TreeBrowsers { case global.analyzer.ImportType(expr) => "ImportType(" + expr.toString + ")" + + case SuperType(thistpe, supertpe) => + Document.group( + Document.nest(4, "SuperType(" :/: + toDocument(thistpe) :/: ", " :/: + toDocument(supertpe) ::")")) case _ => - throw new Error("Unknown case: " + t.toString()) + throw new Error("Unknown case: " + t.toString() +", "+ t.getClass) } } |