summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-10-29 08:55:27 +0000
committerpaltherr <paltherr@epfl.ch>2003-10-29 08:55:27 +0000
commitb960d0b0e58b06d26d17e94d807e2de1b80ceccf (patch)
treed7303336a7fb191cf167a87260311180ddde7b42
parent76da137f37c8c9275d70c1dfb2b43a72b70c0d68 (diff)
downloadscala-b960d0b0e58b06d26d17e94d807e2de1b80ceccf.tar.gz
scala-b960d0b0e58b06d26d17e94d807e2de1b80ceccf.tar.bz2
scala-b960d0b0e58b06d26d17e94d807e2de1b80ceccf.zip
- Added method printValueParams & printTypeParams
-rw-r--r--sources/scalac/symtab/SymbolTablePrinter.java47
1 files changed, 27 insertions, 20 deletions
diff --git a/sources/scalac/symtab/SymbolTablePrinter.java b/sources/scalac/symtab/SymbolTablePrinter.java
index d5ab0a2e41..a56a082d5d 100644
--- a/sources/scalac/symtab/SymbolTablePrinter.java
+++ b/sources/scalac/symtab/SymbolTablePrinter.java
@@ -358,7 +358,7 @@ public class SymbolTablePrinter {
return this;
}
- /** Prints the given symbol */
+ /** Prints the given symbol. */
public SymbolTablePrinter printSymbol(Symbol symbol) {
if (symbol.isAnonymousClass()) {
print("<template>");
@@ -370,7 +370,7 @@ public class SymbolTablePrinter {
}
}
- /** Prints the signature of the given symbol */
+ /** Prints the signature of the given symbol. */
public SymbolTablePrinter printSignature(Symbol symbol) {
String keyword = getSymbolKeyword(symbol);
if (keyword != null) print(keyword).space();
@@ -380,6 +380,28 @@ public class SymbolTablePrinter {
.printSymbolType(symbol, inner);
}
+
+ /** Prints the given type parameter section. */
+ public SymbolTablePrinter printTypeParams(Symbol[] tparams) {
+ print('[');
+ for (int i = 0; i < tparams.length; i++) {
+ if (i > 0) print(",");
+ printSignature(tparams[i]);
+ }
+ return print(']');
+ }
+
+ /** Prints the given value parameter section. */
+ public SymbolTablePrinter printValueParams(Symbol[] vparams) {
+ print('(');
+ for (int i = 0; i < vparams.length; i++) {
+ if (i > 0) print(",");
+ if ((vparams[i].flags & Modifiers.DEF) != 0) print("def ");
+ printSymbolType(vparams[i], null);
+ }
+ return print(')');
+ }
+
//########################################################################
// Public Methods - Printing types
@@ -448,26 +470,11 @@ public class SymbolTablePrinter {
}
public SymbolTablePrinter printType0(Type type, String inner) {
switch (type) {
- case MethodType(Symbol[] vparams, Type result):
- print('(');
- for (int i = 0; i < vparams.length; i++) {
- if (i > 0) print(",");
- if ((vparams[i].flags & Modifiers.DEF) != 0)
- print("def ");
- printSymbolType(vparams[i], null);
- }
- print(')');
- return printType(result, inner);
case PolyType(Symbol[] tparams, Type result):
- if (tparams.length != 0 || global.debug) {
- print('[');
- for (int i = 0; i < tparams.length; i++) {
- if (i > 0) print(",");
- printSignature(tparams[i]);
- }
- print(']');
- }
+ if (tparams.length != 0 || global.debug) printTypeParams(tparams);
return printType(result, inner);
+ case MethodType(Symbol[] vparams, Type result):
+ return printValueParams(vparams).printType(result, inner);
default:
if (inner != null) {
if (!inner.startsWith(":")) space();