summaryrefslogtreecommitdiff
path: root/sources/scalac/ast/printer/TextTreePrinter.java
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-04-30 09:06:27 +0000
committerMartin Odersky <odersky@gmail.com>2003-04-30 09:06:27 +0000
commit21f24de326d79515c44f80665f9679410389b1ab (patch)
treebc8820c917f88ecda8469c90bd7f7298fdc27975 /sources/scalac/ast/printer/TextTreePrinter.java
parente0d3451834b3cc5748dadb6b53971c05878faee4 (diff)
downloadscala-21f24de326d79515c44f80665f9679410389b1ab.tar.gz
scala-21f24de326d79515c44f80665f9679410389b1ab.tar.bz2
scala-21f24de326d79515c44f80665f9679410389b1ab.zip
*** empty log message ***
Diffstat (limited to 'sources/scalac/ast/printer/TextTreePrinter.java')
-rw-r--r--sources/scalac/ast/printer/TextTreePrinter.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/sources/scalac/ast/printer/TextTreePrinter.java b/sources/scalac/ast/printer/TextTreePrinter.java
index c7375c1fcc..a943ca20f4 100644
--- a/sources/scalac/ast/printer/TextTreePrinter.java
+++ b/sources/scalac/ast/printer/TextTreePrinter.java
@@ -182,6 +182,7 @@ public class TextTreePrinter implements TreePrinter {
protected static final Text TXT_DOT = Text.Simple(".");
protected static final Text TXT_COMMA = Text.Simple(",");
protected static final Text TXT_EQUAL = Text.Simple("=");
+ protected static final Text TXT_SUPERTYPE = Text.Simple(">:");
protected static final Text TXT_SUBTYPE = Text.Simple("<:");
protected static final Text TXT_HASH = Text.Simple("#");
protected static final Text TXT_RIGHT_ARROW = Text.Simple("=>");
@@ -317,13 +318,17 @@ public class TextTreePrinter implements TreePrinter {
case TypeDef(int mods,
Name name,
- Tree rhs):
+ Tree rhs,
+ Tree lobound):
printModifiers(mods);
print(KW_TYPE);
print(Text.Space);
printSymbolDefinition(tree.symbol(), name);
- if ((mods & (Modifiers.DEFERRED | Modifiers.PARAM)) != 0) printOpt(TXT_SUBTYPE, rhs, true);
- else printOpt(TXT_EQUAL, rhs, true);
+ if ((mods & (Modifiers.DEFERRED | Modifiers.PARAM)) != 0) {
+ printBounds(lobound, rhs);
+ } else {
+ printOpt(TXT_EQUAL, rhs, true);
+ }
break;
case Import(Tree expr, Name[] selectors):
@@ -683,10 +688,10 @@ public class TextTreePrinter implements TreePrinter {
protected void printParam(Tree tree) {
switch (tree) {
- case TypeDef(int mods, Name name, Tree bound):
+ case TypeDef(int mods, Name name, Tree bound, Tree lobound):
printModifiers(mods);
printSymbolDefinition(tree.symbol(), name);
- printOpt(TXT_SUBTYPE, bound, true);
+ printBounds(lobound, bound);
break;
case ValDef(int mods, Name name, Tree tpe, Tree.Empty):
@@ -699,4 +704,12 @@ public class TextTreePrinter implements TreePrinter {
Debug.abort("bad parameter: " + tree);
}
}
+
+ protected void printBounds(Tree lobound, Tree hibound) {
+ if (lobound.toString() != "scala.All")
+ printOpt(TXT_SUPERTYPE, lobound, true);
+ if (hibound.toString() != "scala.Any")
+ printOpt(TXT_SUBTYPE, hibound, true);
+ }
+
}