summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2005-12-05 16:22:11 +0000
committermichelou <michelou@epfl.ch>2005-12-05 16:22:11 +0000
commitb98f4638334c8c38ff6f4499f8a91ede4871e3e3 (patch)
tree939523217f7a1148824e00089186e5e5084cc1e2 /sources
parent0da6b578845f0799b8b1610f2cf6768f64cadcfc (diff)
downloadscala-b98f4638334c8c38ff6f4499f8a91ede4871e3e3.tar.gz
scala-b98f4638334c8c38ff6f4499f8a91ede4871e3e3.tar.bz2
scala-b98f4638334c8c38ff6f4499f8a91ede4871e3e3.zip
- also prints out constructor id's when possibl...
- also prints out constructor id's when possible (thx to Phil)
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala17
1 files changed, 14 insertions, 3 deletions
diff --git a/sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala b/sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala
index afea22df28..fc6b66e559 100644
--- a/sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala
+++ b/sources/scala/tools/scalac/ast/printer/TextTreePrinter.scala
@@ -806,6 +806,8 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter)
/** Print template. */
def printTemplate(clasz: Symbol, template: Tree.Template): Unit = {
val local = template.symbol();
+ val constructors = if (clasz == null) null else clasz.allConstructors();
+ val primary = if (clasz == null) null else clasz.primaryConstructor();
val parents = template.parents;
val body = template.body;
val types = new ArrayList();
@@ -828,11 +830,20 @@ class TextTreePrinter(global0: scalac_Global, out0: PrintWriter)
printArray(parents, None, None, TXT_WITH_SP);
}
// print local
- if (global.uniqid && local != null) {
+ if (global.uniqid && (local != null || constructors != null)) {
print(Space);
printString("/*");
- printString("local");
- printUniqueIdOf(local);
+ if (constructors != null) {
+ printString("constructors");
+ printUniqueIdOf(constructors);
+ printString(",primary");
+ printUniqueIdOf(primary);
+ }
+ if (local != null) {
+ if (constructors != null) printString(",");
+ printString("local");
+ printUniqueIdOf(local);
+ }
printString("*/");
}
// print body