mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
24 lines
405 B
C++
24 lines
405 B
C++
#include <Parsers/formatAST.h>
|
|
|
|
#include <sstream>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
void formatAST(const IAST & ast, std::ostream & s, bool hilite, bool one_line)
|
|
{
|
|
IAST::FormatSettings settings(s, one_line);
|
|
settings.hilite = hilite;
|
|
|
|
ast.format(settings);
|
|
}
|
|
|
|
String serializeAST(const IAST & ast, bool one_line)
|
|
{
|
|
std::stringstream ss;
|
|
formatAST(ast, ss, false, one_line);
|
|
return ss.str();
|
|
}
|
|
|
|
}
|