StringWithFlags returns the AST formatted as a string (with the given flags).
(flags tree.FmtFlags)
| 82 | |
| 83 | // StringWithFlags returns the AST formatted as a string (with the given flags). |
| 84 | func (stmts Statements) StringWithFlags(flags tree.FmtFlags) string { |
| 85 | ctx := tree.NewFmtCtx(flags) |
| 86 | for i, s := range stmts { |
| 87 | if i > 0 { |
| 88 | ctx.WriteString("; ") |
| 89 | } |
| 90 | ctx.FormatNode(s.AST) |
| 91 | } |
| 92 | return ctx.CloseAndGetString() |
| 93 | } |
| 94 | |
| 95 | // Parser wraps a scanner, parser and other utilities present in the parser |
| 96 | // package. |
no test coverage detected