1#include <Parsers/formatAST.h>
2
3#include <sstream>
4
5namespace DB
6{
7
8void 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
16String 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