ClickHouse/dbms/Parsers/iostream_debug_helpers.cpp

33 lines
767 B
C++
Raw Normal View History

#include "iostream_debug_helpers.h"
2019-10-28 05:42:51 +00:00
#include <Parsers/IAST.h>
#include <Parsers/IParser.h>
#include <Parsers/Lexer.h>
#include <Parsers/TokenIterator.h>
namespace DB
{
2018-05-07 02:01:11 +00:00
std::ostream & operator<<(std::ostream & stream, const Token & what)
{
stream << "Token (type="<< static_cast<int>(what.type) <<"){"<< std::string{what.begin, what.end} << "}";
return stream;
}
2018-05-07 02:01:11 +00:00
std::ostream & operator<<(std::ostream & stream, const Expected & what)
{
stream << "Expected {variants=";
dumpValue(stream, what.variants)
<< "; max_parsed_pos=" << what.max_parsed_pos << "}";
return stream;
}
2019-10-28 05:42:51 +00:00
std::ostream & operator<<(std::ostream & stream, const IAST & what)
{
stream << "IAST{";
what.dumpTree(stream);
stream << "}";
return stream;
}
}