NodeString is a convenience function that prints n in ShortForm and returns the printed string.
(n Node)
| 47 | // NodeString is a convenience function that prints n in ShortForm |
| 48 | // and returns the printed string. |
| 49 | func NodeString(n Node) string { |
| 50 | var buf bytes.Buffer |
| 51 | _, err := Fprint(&buf, n, ShortForm) |
| 52 | if err != nil { |
| 53 | fmt.Fprintf(&buf, "<<< ERROR: %s", err) |
| 54 | } |
| 55 | return buf.String() |
| 56 | } |
| 57 | |
| 58 | type ctrlSymbol int |
| 59 |