String returns a string representation of prim in DOT format. Example output: digraph pre_loop { cond -> body cond -> exit body -> cond }
()
| 58 | // body -> cond |
| 59 | // } |
| 60 | func (prim PreLoop) String() string { |
| 61 | cond, body, exit := label(prim.Cond), label(prim.Body), label(prim.Exit) |
| 62 | const format = ` |
| 63 | digraph pre_loop { |
| 64 | %v -> %v |
| 65 | %v -> %v |
| 66 | %v -> %v |
| 67 | }` |
| 68 | return fmt.Sprintf(format[1:], cond, body, cond, exit, body, cond) |
| 69 | } |
| 70 | |
| 71 | // FindPreLoop returns the first occurrence of a pre-test loop in g, and a |
| 72 | // boolean indicating if such a primitive was found. |