2017-04-01 09:19:00 +00:00
|
|
|
#include <Parsers/formatAST.h>
|
2010-06-28 13:44:42 +00:00
|
|
|
|
2017-04-13 13:42:29 +00:00
|
|
|
#include <sstream>
|
2010-06-28 13:44:42 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2017-12-01 18:36:55 +00:00
|
|
|
void formatAST(const IAST & ast, std::ostream & s, bool hilite, bool one_line)
|
2017-04-13 13:42:29 +00:00
|
|
|
{
|
2018-07-16 01:02:46 +00:00
|
|
|
IAST::FormatSettings settings(s, one_line);
|
|
|
|
settings.hilite = hilite;
|
|
|
|
|
2017-04-13 13:42:29 +00:00
|
|
|
ast.format(settings);
|
|
|
|
}
|
|
|
|
|
2018-11-01 13:30:38 +00:00
|
|
|
String serializeAST(const IAST & ast, bool one_line)
|
|
|
|
{
|
|
|
|
std::stringstream ss;
|
|
|
|
formatAST(ast, ss, false, one_line);
|
|
|
|
return ss.str();
|
|
|
|
}
|
|
|
|
|
2010-06-28 13:44:42 +00:00
|
|
|
}
|