@@ -378,13 +378,15 @@ trait ExprBuilder {
378378 def toDot : String = {
379379 val states = asyncStates
380380 def toHtmlLabel (label : String , preText : String , builder : StringBuilder ): Unit = {
381+ val br = " <br align=\" left\" />"
381382 builder.append(" <b>" ).append(label).append(" </b>" ).append(" <br/>" )
382383 builder.append(" <font face=\" Courier\" >" )
383384 preText.split(" \n " ).foreach {
384385 (line : String ) =>
385- builder.append(" <br/> " )
386- builder.append(line.replaceAllLiterally(" \" " , " "" ).replaceAllLiterally(" <" , " <" ).replaceAllLiterally(" >" , " >" ))
386+ builder.append(br )
387+ builder.append(line.replaceAllLiterally(" \" " , " "" ).replaceAllLiterally(" <" , " <" ).replaceAllLiterally(" >" , " >" ).replaceAllLiterally( " " , " " ) )
387388 }
389+ builder.append(br)
388390 builder.append(" </font>" )
389391 }
390392 val dotBuilder = new StringBuilder ()
@@ -395,11 +397,17 @@ trait ExprBuilder {
395397 val length = asyncStates.size
396398 for ((state, i) <- asyncStates.zipWithIndex) {
397399 dotBuilder.append(s """ ${stateLabel(state.state)} [label= """ ).append(" <" )
400+ def show (t : Tree ): String = {
401+ (t match {
402+ case Block (stats, expr) => stats ::: expr :: Nil
403+ case t => t :: Nil
404+ }).iterator.map(t => showCode(t)).mkString(" \n " )
405+ }
398406 if (i != length - 1 ) {
399407 val CaseDef (_, _, body) = state.mkHandlerCaseForState
400- toHtmlLabel(stateLabel(state.state), showCode (compactStateTransform.transform(body)), dotBuilder)
408+ toHtmlLabel(stateLabel(state.state), show (compactStateTransform.transform(body)), dotBuilder)
401409 } else {
402- toHtmlLabel(stateLabel(state.state), state.allStats.map(showCode (_)).mkString(" \n " ), dotBuilder)
410+ toHtmlLabel(stateLabel(state.state), state.allStats.map(show (_)).mkString(" \n " ), dotBuilder)
403411 }
404412 dotBuilder.append(" > ]\n " )
405413 }
0 commit comments