@@ -38,6 +38,7 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
38
38
def result (): String = sb.result()
39
39
40
40
def lineBreak (): String = " \n " + (" " * indent)
41
+ def doubleLineBreak (): String = " \n\n " + (" " * indent)
41
42
42
43
def printTree (tree : Tree ): Buffer = tree match {
43
44
case tree @ PackageClause (Term .Ident (name), stats) =>
@@ -391,14 +392,13 @@ class ShowSourceCode[T <: Tasty with Singleton](tasty0: T) extends Show[T](tasty
391
392
392
393
def printStats (stats : List [Tree ], expr : Tree ): Unit = {
393
394
def printSeparator (nextStats : List [Tree ]) = {
394
- this += lineBreak()
395
395
// Avoid accidental application of opening `{` on next line with a double break
396
396
val next = if (nextStats.isEmpty) expr else nextStats.head
397
397
next match {
398
- case Term .Block (DefDef (" while$" | " doWhile$" , _, _, _, _) :: Nil , _) =>
399
- case Term .Block (_, _) => this += lineBreak ()
400
- case Term .Inlined (_, _, _) => this += lineBreak ()
401
- case _ =>
398
+ case Term .Block (DefDef (" while$" | " doWhile$" , _, _, _, _) :: Nil , _) => this += lineBreak()
399
+ case Term .Block (_, _) => this += doubleLineBreak ()
400
+ case Term .Inlined (_, _, _) => this += doubleLineBreak ()
401
+ case _ => this += lineBreak()
402
402
}
403
403
}
404
404
def printSeparated (list : List [Tree ]): Unit = list match {
0 commit comments