ClickHouse/dbms/src/Parsers/IParserBase.cpp

32 lines
407 B
C++
Raw Normal View History

#include <Parsers/IParserBase.h>
namespace DB
{
namespace ErrorCodes
{
extern const int LOGICAL_ERROR;
}
bool IParserBase::parse(Pos & pos, ASTPtr & node, Expected & expected)
{
Pos begin = pos;
expected.add(pos, getName());
bool res = parseImpl(pos, node, expected);
/// TODO expected
if (!res)
{
node = nullptr;
pos = begin;
}
return res;
}
}