@@ -394,7 +394,7 @@ trait ExprBuilder {
394394 def stateLabel (s : Int ) = {
395395 if (s == 0 ) " INITIAL" else if (s == Int .MaxValue ) " TERMINAL" else switchIds.getOrElse(s, s).toString
396396 }
397- val length = asyncStates .size
397+ val length = states .size
398398 for ((state, i) <- asyncStates.zipWithIndex) {
399399 dotBuilder.append(s """ ${stateLabel(state.state)} [label= """ ).append(" <" )
400400 def show (t : Tree ): String = {
@@ -410,10 +410,30 @@ trait ExprBuilder {
410410 toHtmlLabel(stateLabel(state.state), state.allStats.map(show(_)).mkString(" \n " ), dotBuilder)
411411 }
412412 dotBuilder.append(" > ]\n " )
413+ state match {
414+ case s : AsyncStateWithAwait =>
415+ val CaseDef (_, _, body) = s.mkOnCompleteHandler.get
416+ dotBuilder.append(s """ ${stateLabel(s.onCompleteState)} [label= """ ).append(" <" )
417+ toHtmlLabel(stateLabel(s.onCompleteState), show(compactStateTransform.transform(body)), dotBuilder)
418+ dotBuilder.append(" > ]\n " )
419+ case _ =>
420+ }
413421 }
414- for (state <- states; succ <- state.nextStates) {
415- dotBuilder.append(s """ ${stateLabel(state.state)} -> ${stateLabel(succ)}""" )
416- dotBuilder.append(" \n " )
422+ for (state <- states) {
423+ state match {
424+ case s : AsyncStateWithAwait =>
425+ dotBuilder.append(s """ ${stateLabel(state.state)} -> ${stateLabel(s.onCompleteState)} [style=dashed color=red] """ )
426+ dotBuilder.append(" \n " )
427+ for (succ <- state.nextStates) {
428+ dotBuilder.append(s """ ${stateLabel(s.onCompleteState)} -> ${stateLabel(succ)}""" )
429+ dotBuilder.append(" \n " )
430+ }
431+ case _ =>
432+ for (succ <- state.nextStates) {
433+ dotBuilder.append(s """ ${stateLabel(state.state)} -> ${stateLabel(succ)}""" )
434+ dotBuilder.append(" \n " )
435+ }
436+ }
417437 }
418438 dotBuilder.append(" }\n " )
419439 dotBuilder.toString
0 commit comments