From 1f97bdd390266f51d12b0757e61babc0e36207ae Mon Sep 17 00:00:00 2001 From: paltherr Date: Tue, 24 Jun 2003 15:26:25 +0000 Subject: - Moved interpreter-specific code out of class ... - Moved interpreter-specific code out of class SymbolTablePrinter --- sources/scalac/Global.java | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'sources/scalac/Global.java') diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java index 51ecb2a7a6..d8c46c4df6 100644 --- a/sources/scalac/Global.java +++ b/sources/scalac/Global.java @@ -438,11 +438,33 @@ public class Global { } private String show(Symbol symbol) { - return new SymbolTablePrinter(" ").printSignature(symbol).toString(); + return new InterpreterPrinter().printSignature(symbol).toString(); } private String show(Type type) { - return new SymbolTablePrinter(" ").printType(type).toString(); + return new InterpreterPrinter().printType(type).toString(); + } + + private class InterpreterPrinter extends SymbolTablePrinter { + public InterpreterPrinter() { + super(" "); + } + public String getSymbolName(Symbol symbol) { + String string = super.getSymbolName(symbol); + if (!debug) { + int index = string.indexOf('$'); + if (index > 0) string = string.substring(0, index); + } + return string; + } + public String getSymbolFullName(Symbol symbol) { + String string = super.getSymbolFullName(symbol); + if (!debug) { + int index = string.indexOf('$'); + if (index > 0) string = string.substring(0, index); + } + return string; + } } // !!! >>> Interpreter stuff -- cgit v1.2.3