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