diff options
author | michelou <michelou@epfl.ch> | 2005-07-18 17:54:27 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2005-07-18 17:54:27 +0000 |
commit | f750bc83b416fdfaf865b15119610d0331e02eaa (patch) | |
tree | afffe8865d03efbbf1b33163226aeeacc2d66b6f | |
parent | 43f25bbed927ee745c38df6ed9f84cfe0c5e3e06 (diff) | |
download | scala-f750bc83b416fdfaf865b15119610d0331e02eaa.tar.gz scala-f750bc83b416fdfaf865b15119610d0331e02eaa.tar.bz2 scala-f750bc83b416fdfaf865b15119610d0331e02eaa.zip |
- prints out Scala attributes.
-rw-r--r-- | sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala b/sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala index dff1ebc0d2..2a177ef068 100644 --- a/sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala +++ b/sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala @@ -257,6 +257,7 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter) def printATree(tree: Tree, symbol: Symbol): Unit = tree match { case Tree.ClassDef(_, _, _, _, _, impl) => + printAttributes(symbol); printAModifiers(symbol); print(if (symbol.isInterface()) KW_INTERFACE else KW_CLASS); print(Space); @@ -267,6 +268,7 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter) printTemplate(symbol, impl); case Tree.ModuleDef(_, _, _, impl) => + printAttributes(symbol); printAModifiers(symbol); print(KW_OBJECT); print(Space); @@ -277,6 +279,7 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter) printTemplate(clasz, impl); case Tree.ValDef(_, _, _, rhs) => + printAttributes(symbol); printAModifiers(symbol); if (symbol.isModule()) print(TXT_OBJECT_COMMENT); print(if (symbol.isVariable()) KW_VAR else KW_VAL); @@ -291,6 +294,7 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter) } case Tree.DefDef(_, _, _, _, _, rhs) => + printAttributes(symbol); printAModifiers(symbol); print(KW_DEF); print(Space); @@ -305,6 +309,7 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter) printOpt(TXT_EQUAL, rhs, true); case Tree.AbsTypeDef(_, _, _, _) => + printAttributes(symbol); printAModifiers(symbol); print(KW_TYPE); print(Space); @@ -312,6 +317,7 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter) printABoundsOf(symbol); case Tree.AliasTypeDef(_, _, _, _) => + printAttributes(symbol); printAModifiers(symbol); print(KW_TYPE); print(Space); @@ -786,6 +792,14 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter) } } + def printAttributes(symbol: Symbol): Unit = { + val attrs = global.getAttributes(symbol); + if (attrs != null) { + print(attrs.toString()); + print(Space); + } + } + //########################################################################## // Public Methods - Printing templates |