@@ -394,7 +394,7 @@ trait ExprBuilder {
394
394
def stateLabel (s : Int ) = {
395
395
if (s == 0 ) " INITIAL" else if (s == Int .MaxValue ) " TERMINAL" else switchIds.getOrElse(s, s).toString
396
396
}
397
- val length = asyncStates .size
397
+ val length = states .size
398
398
for ((state, i) <- asyncStates.zipWithIndex) {
399
399
dotBuilder.append(s """ ${stateLabel(state.state)} [label= """ ).append(" <" )
400
400
def show (t : Tree ): String = {
@@ -410,10 +410,30 @@ trait ExprBuilder {
410
410
toHtmlLabel(stateLabel(state.state), state.allStats.map(show(_)).mkString(" \n " ), dotBuilder)
411
411
}
412
412
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
+ }
413
421
}
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
+ }
417
437
}
418
438
dotBuilder.append(" }\n " )
419
439
dotBuilder.toString
0 commit comments