diff --git a/src/main/scala/leon/purescala/PrettyPrinter.scala b/src/main/scala/leon/purescala/PrettyPrinter.scala index acc091cefda34fd2882c11ab48ecb44639391901..c03798d6243da1b0cb552ad754381dad042f1137 100644 --- a/src/main/scala/leon/purescala/PrettyPrinter.scala +++ b/src/main/scala/leon/purescala/PrettyPrinter.scala @@ -254,7 +254,7 @@ class PrettyPrinter(sb: StringBuffer = new StringBuffer) { pp(pat, p) sb.append(" =>\n") ind(lvl+1) - pp(rhs, p)(lvl+2) + pp(rhs, p)(lvl+1) case GuardedCase(pat, guard, rhs) => sb.append("case ") pp(pat, p) @@ -262,7 +262,7 @@ class PrettyPrinter(sb: StringBuffer = new StringBuffer) { pp(guard, p) sb.append(" =>\n") ind(lvl+1) - pp(rhs, p)(lvl+2) + pp(rhs, p)(lvl+1) // Patterns case CaseClassPattern(bndr, ccd, subps) => diff --git a/src/main/scala/leon/purescala/ScalaPrinter.scala b/src/main/scala/leon/purescala/ScalaPrinter.scala index 348e2ef146423fadb5937ba1780a85800b3e28bb..bc186b293d25f5e0615f916cc3638aee6d6626b7 100644 --- a/src/main/scala/leon/purescala/ScalaPrinter.scala +++ b/src/main/scala/leon/purescala/ScalaPrinter.scala @@ -393,7 +393,7 @@ class ScalaPrinter(sb: StringBuffer = new StringBuffer) extends PrettyPrinter(sb private def requiresBraces(ex: Tree, within: Option[Tree]): Boolean = (ex, within) match { case (_, None) => false case (_, Some(_: Definition)) => false - case (_, Some(_: MatchExpr | _: Let | _: LetTuple | _: LetDef)) => false + case (_, Some(_: MatchExpr | _: MatchCase | _: Let | _: LetTuple | _: LetDef)) => false case (_, _) => true } @@ -411,7 +411,7 @@ class ScalaPrinter(sb: StringBuffer = new StringBuffer) extends PrettyPrinter(sb private def requiresParentheses(ex: Tree, within: Option[Tree]): Boolean = (ex, within) match { case (_, None) => false case (_, Some(_: Definition)) => false - case (_, Some(_: MatchExpr | _: Let | _: LetTuple | _: LetDef | _: IfExpr)) => false + case (_, Some(_: MatchExpr | _: MatchCase | _: Let | _: LetTuple | _: LetDef | _: IfExpr)) => false case (_, Some(_: FunctionInvocation)) => false case (ie: IfExpr, _) => true case (e1: Expr, Some(e2: Expr)) if precedence(e1) > precedence(e2) => false