mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 21:42:39 +00:00
23 lines
399 B
C++
23 lines
399 B
C++
#include <Parsers/formatAST.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void formatAST(const IAST & ast, WriteBuffer & buf, bool hilite, bool one_line)
|
|
{
|
|
IAST::FormatSettings settings(buf, one_line);
|
|
settings.hilite = hilite;
|
|
|
|
ast.format(settings);
|
|
}
|
|
|
|
String serializeAST(const IAST & ast, bool one_line)
|
|
{
|
|
WriteBufferFromOwnString buf;
|
|
formatAST(ast, buf, false, one_line);
|
|
return buf.str();
|
|
}
|
|
|
|
}
|