diff options
author | ilyas <ilyas@epfl.ch> | 2010-03-01 10:25:59 +0000 |
---|---|---|
committer | ilyas <ilyas@epfl.ch> | 2010-03-01 10:25:59 +0000 |
commit | 42e67f14202858d42b462bb00831fac3ba6854fa (patch) | |
tree | 03dad5858d09ee036f71919cd63a09a766b173bb /src/scalap | |
parent | 07f1f6dd14f8342f40f139781317755ceb661b96 (diff) | |
download | scala-42e67f14202858d42b462bb00831fac3ba6854fa.tar.gz scala-42e67f14202858d42b462bb00831fac3ba6854fa.tar.bz2 scala-42e67f14202858d42b462bb00831fac3ba6854fa.zip |
Minor printer fix for singleton types
Diffstat (limited to 'src/scalap')
-rw-r--r-- | src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala index a59bcc441a..d4345cdb69 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/scalasig/ScalaSigPrinter.scala @@ -295,8 +295,8 @@ class ScalaSigPrinter(stream: PrintStream, printPrivates: Boolean) { def toString(t: Type)(implicit flags: TypeFlags): String = toString(t, "")(flags) def toString(t: Type, sep: String)(implicit flags: TypeFlags): String = t match { - case ThisType(symbol) => sep + symbol.path + ".type" - case SingleType(typeRef, symbol) => sep + symbol.path + ".type" + case ThisType(symbol) => sep + processName(symbol.path) + ".type" + case SingleType(typeRef, symbol) => sep + processName(symbol.path) + ".type" case ConstantType(constant) => sep + (constant match { case null => "scala.Null" case _: Unit => "scala.Unit" @@ -330,7 +330,7 @@ class ScalaSigPrinter(stream: PrintStream, printPrivates: Boolean) { case MethodType(resultType, _) => toString(resultType, sep) case PolyType(typeRef, symbols) => typeParamString(symbols) + toString(typeRef, sep) - case PolyTypeWithCons(typeRef, symbols, cons) => typeParamString(symbols) + cons + toString(typeRef, sep) + case PolyTypeWithCons(typeRef, symbols, cons) => typeParamString(symbols) + processName(cons) + toString(typeRef, sep) case AnnotatedType(typeRef, attribTreeRefs) => toString(typeRef, sep) case AnnotatedWithSelfType(typeRef, symbol, attribTreeRefs) => toString(typeRef, sep) //case DeBruijnIndexType(typeLevel, typeIndex) => @@ -363,7 +363,8 @@ class ScalaSigPrinter(stream: PrintStream, printPrivates: Boolean) { "\\$minus" -> "-", "\\$eq" -> "=", "\\$less" -> "<", "\\$times" -> "*", "\\$div" -> "/", "\\$bslash" -> "\\\\", "\\$greater" -> ">", "\\$qmark" -> "?", "\\$percent" -> "%", - "\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "→") + "\\$amp" -> "&", "\\$colon" -> ":", "\\$u2192" -> "→", + "\\$hash" -> "#") val pattern = Pattern.compile(_syms.keysIterator.foldLeft("")((x, y) => if (x == "") y else x + "|" + y)) val placeholderPattern = "_\\$(\\d)+" |