diff --git a/src/main/scala/leon/purescala/PrettyPrinter.scala b/src/main/scala/leon/purescala/PrettyPrinter.scala index ebe8260c80372708a220ed55d8daa46c98ac39e5..d13fd83e5abb421b2480843418e106c5f1c0787d 100644 --- a/src/main/scala/leon/purescala/PrettyPrinter.scala +++ b/src/main/scala/leon/purescala/PrettyPrinter.scala @@ -285,7 +285,7 @@ class PrettyPrinter(sb: StringBuffer = new StringBuffer) { // TYPE TREES // all type trees are printed in-line - def ppNaryType(tpes: Seq[TypeTree], pre: String, op: String, post: String, lvl: Int): StringBuffer = { + def ppNaryType(tpes: Seq[TypeTree], pre: String, op: String, post: String, lvl: Int): Unit = { sb.append(pre) val sz = tpes.size var c = 0 @@ -295,10 +295,9 @@ class PrettyPrinter(sb: StringBuffer = new StringBuffer) { }) sb.append(post) - sb } - def pp(tpe: TypeTree, lvl: Int): StringBuffer = tpe match { + def pp(tpe: TypeTree, lvl: Int): Unit = tpe match { case Untyped => sb.append("???") case UnitType => sb.append("Unit") case Int32Type => sb.append("Int") diff --git a/src/main/scala/leon/purescala/ScalaPrinter.scala b/src/main/scala/leon/purescala/ScalaPrinter.scala index 75f5e37f359bed8edd225fb9e27b60ae33f9f682..c0dbb34cfe4424cfaf1af386d821366a10b056f9 100644 --- a/src/main/scala/leon/purescala/ScalaPrinter.scala +++ b/src/main/scala/leon/purescala/ScalaPrinter.scala @@ -291,19 +291,8 @@ class ScalaPrinter(sb: StringBuffer = new StringBuffer) extends PrettyPrinter(sb // TYPE TREES // all type trees are printed in-line - private def ppNaryType(sb: StringBuffer, tpes: Seq[TypeTree], pre: String, op: String, post: String, lvl: Int) = { - sb.append(pre) - val sz = tpes.size - var c = 0 - tpes.foreach(t => { - pp(t, lvl) ; c += 1 ; if(c < sz) sb.append(op) - }) - - sb.append(post) - } - - private def pp(tpe: TypeTree, sb: StringBuffer, lvl: Int): Unit = tpe match { + override def pp(tpe: TypeTree, lvl: Int): Unit = tpe match { case Untyped => sb.append("???") case UnitType => sb.append("Unit") case Int32Type => sb.append("Int") @@ -333,7 +322,7 @@ class ScalaPrinter(sb: StringBuffer = new StringBuffer) extends PrettyPrinter(sb // DEFINITIONS // all definitions are printed with an end-of-line - private def pp(defn: Definition, sb: StringBuffer, lvl: Int): Unit = { + override def pp(defn: Definition, lvl: Int): Unit = { defn match { case Program(id, mainObj) => {