| 1 | #include <Parsers/formatAST.h> |
|---|---|
| 2 | |
| 3 | #include <sstream> |
| 4 | |
| 5 | namespace DB |
| 6 | { |
| 7 | |
| 8 | void formatAST(const IAST & ast, std::ostream & s, bool hilite, bool one_line) |
| 9 | { |
| 10 | IAST::FormatSettings settings(s, one_line); |
| 11 | settings.hilite = hilite; |
| 12 | |
| 13 | ast.format(settings); |
| 14 | } |
| 15 | |
| 16 | String serializeAST(const IAST & ast, bool one_line) |
| 17 | { |
| 18 | std::stringstream ss; |
| 19 | formatAST(ast, ss, false, one_line); |
| 20 | return ss.str(); |
| 21 | } |
| 22 | |
| 23 | } |
| 24 |