提交 bc45598c 编写于 作者: A Alexey Milovidov

Fixed name [#CLICKHOUSE-2].

上级 221c0540
......@@ -18,7 +18,7 @@ std::string ASTQueryWithOnCluster::getRewrittenQueryWithoutOnCluster(const std::
bool ASTQueryWithOnCluster::parse(Pos & pos, Pos end, std::string & cluster_str, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ws.ignore(pos, end);
......
......@@ -37,19 +37,19 @@ bool ParserString::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed
}
ParserWhiteSpace::ParserWhiteSpace(bool allow_newlines_)
ParserWhitespace::ParserWhitespace(bool allow_newlines_)
: allow_newlines(allow_newlines_)
{
}
const char * ParserWhiteSpace::getName() const
const char * ParserWhitespace::getName() const
{
return "white space";
}
bool ParserWhiteSpace::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
bool ParserWhitespace::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
Pos begin = pos;
while (pos < end && (*pos == ' ' || *pos == '\t' || (allow_newlines && *pos == '\n') || *pos == '\r' || *pos == '\f'))
......@@ -128,21 +128,21 @@ bool ParserComment::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parse
}
ParserWhiteSpaceOrComments::ParserWhiteSpaceOrComments(bool allow_newlines_outside_comments_)
ParserWhitespaceOrComments::ParserWhitespaceOrComments(bool allow_newlines_outside_comments_)
: allow_newlines_outside_comments(allow_newlines_outside_comments_)
{
}
const char * ParserWhiteSpaceOrComments::getName() const
const char * ParserWhitespaceOrComments::getName() const
{
return "white space or comments";
}
bool ParserWhiteSpaceOrComments::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
bool ParserWhitespaceOrComments::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpace p1(allow_newlines_outside_comments);
ParserWhitespace p1(allow_newlines_outside_comments);
ParserComment p2;
bool res = false;
......
......@@ -29,10 +29,10 @@ protected:
/** whitespace characters
*/
class ParserWhiteSpace : public IParserBase
class ParserWhitespace : public IParserBase
{
public:
ParserWhiteSpace(bool allow_newlines_ = true);
ParserWhitespace(bool allow_newlines_ = true);
protected:
bool allow_newlines;
......@@ -72,10 +72,10 @@ protected:
};
class ParserWhiteSpaceOrComments : public IParserBase
class ParserWhitespaceOrComments : public IParserBase
{
public:
ParserWhiteSpaceOrComments(bool allow_newlines_outside_comments_ = true);
ParserWhitespaceOrComments(bool allow_newlines_outside_comments_ = true);
protected:
bool allow_newlines_outside_comments;
......
......@@ -40,7 +40,7 @@ bool ParserArray::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_
ASTPtr contents_node;
ParserString open("["), close("]");
ParserExpressionList contents(false);
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
if (!open.ignore(pos, end, max_parsed_pos, expected))
return false;
......@@ -69,7 +69,7 @@ bool ParserParenthesisExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, P
ASTPtr contents_node;
ParserString open("("), close(")");
ParserExpressionList contents(false);
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
if (!open.ignore(pos, end, max_parsed_pos, expected))
return false;
......@@ -114,7 +114,7 @@ bool ParserSubquery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_pars
ASTPtr select_node;
ParserString open("("), close(")");
ParserSelectQuery select;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
if (!open.ignore(pos, end, max_parsed_pos, expected))
return false;
......@@ -206,7 +206,7 @@ bool ParserFunction::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_pars
ParserString open("("), close(")");
ParserString distinct("DISTINCT", true, true);
ParserExpressionList contents(false);
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
bool has_distinct_modifier = false;
......@@ -330,7 +330,7 @@ bool ParserCastExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & ma
/// Parse as CAST(expression AS type)
ParserString open("("), close(")"), comma(",");
ParserExpressionInCastExpression expression_and_type(false);
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ASTPtr expr_list_args;
......@@ -553,7 +553,7 @@ bool ParserArrayOfLiterals::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & m
return false;
}
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserLiteral literal_p;
++pos;
......@@ -649,7 +649,7 @@ const char * ParserAliasBase::restricted_keywords[] =
template <typename ParserIdentifier>
bool ParserAliasImpl<ParserIdentifier>::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_as("AS", true, true);
ParserIdentifier id_p;
......@@ -702,12 +702,12 @@ bool ParserQualifiedAsterisk::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos &
if (!ParserCompoundIdentifier().parse(pos, end, node, max_parsed_pos, expected))
return false;
ParserWhiteSpaceOrComments().ignore(pos, end);
ParserWhitespaceOrComments().ignore(pos, end);
if (!ParserString(".").ignore(pos, end, max_parsed_pos, expected))
return false;
ParserWhiteSpaceOrComments().ignore(pos, end);
ParserWhitespaceOrComments().ignore(pos, end);
if (!ParserString("*").ignore(pos, end, max_parsed_pos, expected))
return false;
......@@ -767,7 +767,7 @@ bool ParserExpressionElement::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos &
template <typename ParserAlias>
bool ParserWithOptionalAliasImpl<ParserAlias>::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
if (!elem_parser->parse(pos, end, node, max_parsed_pos, expected))
return false;
......@@ -824,7 +824,7 @@ bool ParserOrderByElement::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & ma
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserExpressionWithOptionalAlias elem_p(false);
ParserString ascending("ASCENDING", true, true);
ParserString descending("DESCENDING", true, true);
......@@ -891,7 +891,7 @@ bool ParserWeightedZooKeeperPath::parseImpl(Pos & pos, Pos end, ASTPtr & node, P
ParserString s_weight("WEIGHT", true, true);
ParserStringLiteral path_p;
ParserUnsignedInteger weight_p;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
auto weighted_zookeeper_path = std::make_shared<ASTWeightedZooKeeperPath>();
node = weighted_zookeeper_path;
......
......@@ -76,7 +76,7 @@ const char * ParserTupleElementExpression::operators[] =
bool ParserList::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
bool first = true;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
auto list = std::make_shared<ASTExpressionList>();
node = list;
......@@ -122,7 +122,7 @@ bool ParserList::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_p
bool ParserLeftAssociativeBinaryOperatorList::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
bool first = true;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
Pos begin = pos;
while (1)
......@@ -198,7 +198,7 @@ bool ParserLeftAssociativeBinaryOperatorList::parseImpl(Pos & pos, Pos end, ASTP
bool ParserVariableArityOperatorList::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
Pos begin = pos;
ASTPtr arguments;
......@@ -239,7 +239,7 @@ bool ParserBetweenExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos &
/// For the expression (subject BETWEEN left AND right)
/// create an AST the same as for (subject> = left AND subject <= right).
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_between("BETWEEN", true, true);
ParserString s_and("AND", true, true);
......@@ -320,7 +320,7 @@ bool ParserBetweenExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos &
bool ParserTernaryOperatorExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString symbol1("?");
ParserString symbol2(":");
......@@ -381,7 +381,7 @@ bool ParserTernaryOperatorExpression::parseImpl(Pos & pos, Pos end, ASTPtr & nod
bool ParserLambdaExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString arrow("->");
ParserString open("(");
ParserString close(")");
......@@ -448,7 +448,7 @@ bool ParserLambdaExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos &
bool ParserPrefixUnaryOperatorExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
/// try to find any of the valid operators
Pos begin = pos;
......@@ -600,7 +600,7 @@ bool ParserOrderByExpressionList::parseImpl(Pos & pos, Pos end, ASTPtr & node, P
bool ParserNullityChecking::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ASTPtr node_comp;
if (!ParserComparisonExpression{}.parse(pos, end, node_comp, max_parsed_pos, expected))
......
......@@ -42,7 +42,7 @@ bool ParserAlterQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_pa
ParserString s_comma(",");
ParserString s_doubledot("..");
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserIdentifier table_parser;
ParserCompoundIdentifier parser_name;
......
......@@ -12,7 +12,7 @@ bool ParserCase::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_p
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_case{"CASE", true, true};
ParserString s_when{"WHEN", true, true};
ParserString s_then{"THEN", true, true};
......
......@@ -12,7 +12,7 @@ namespace DB
bool ParserCheckQuery::parseImpl(IParser::Pos & pos, IParser::Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_check("CHECK", true, true);
ParserString s_table("TABLE", true, true);
ParserString s_dot(".");
......
......@@ -12,7 +12,7 @@ namespace DB
bool ParserNestedTable::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString open("(");
ParserString close(")");
ParserIdentifier name_p;
......@@ -115,7 +115,7 @@ bool ParserColumnDeclarationList::parseImpl(Pos & pos, Pos end, ASTPtr & node, P
bool ParserEngine::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_engine("ENGINE", true, true);
ParserString s_eq("=");
ParserIdentifierWithOptionalParameters storage_p;
......@@ -145,7 +145,7 @@ bool ParserCreateQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_p
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_create("CREATE", true, true);
ParserString s_temporary("TEMPORARY", true, true);
ParserString s_attach("ATTACH", true, true);
......
......@@ -74,7 +74,7 @@ bool IParserNameTypePair<NameParser>::parseImpl(Pos & pos, Pos end, ASTPtr & nod
{
NameParser name_parser;
ParserIdentifierWithOptionalParameters type_parser;
ParserWhiteSpaceOrComments ws_parser;
ParserWhitespaceOrComments ws_parser;
Pos begin = pos;
......@@ -119,7 +119,7 @@ bool IParserColumnDeclaration<NameParser>::parseImpl(Pos & pos, Pos end, ASTPtr
{
NameParser name_parser;
ParserIdentifierWithOptionalParameters type_parser;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_default{"DEFAULT", true, true};
ParserString s_materialized{"MATERIALIZED", true, true};
ParserString s_alias{"ALIAS", true, true};
......
......@@ -15,7 +15,7 @@ bool ParserDropQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_par
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_drop("DROP", true, true);
ParserString s_detach("DETACH", true, true);
ParserString s_table("TABLE", true, true);
......
......@@ -9,7 +9,7 @@ namespace DB
bool ParserEnumElement::parseImpl(IParser::Pos & pos, IParser::Pos end, ASTPtr & node, IParser::Pos & max_parsed_pos, Expected & expected)
{
ParserString equality_sign_parser("=");
ParserWhiteSpace ws;
ParserWhitespace ws;
const auto begin = pos;
ASTPtr name;
......
......@@ -25,7 +25,7 @@ bool ParserInsertQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_p
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_insert("INSERT", true, true);
ParserString s_into("INTO", true, true);
ParserString s_dot(".");
......@@ -104,7 +104,7 @@ bool ParserInsertQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_p
return false;
/// Data starts after the first newline, if there is one, or after all the whitespace characters, otherwise.
ParserWhiteSpaceOrComments ws_without_nl(false);
ParserWhitespaceOrComments ws_without_nl(false);
ws_without_nl.ignore(pos, end);
if (pos != end && *pos == ';')
......
......@@ -21,7 +21,7 @@ bool ParserKillQueryQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & ma
Pos begin = pos;
auto query = std::make_shared<ASTKillQueryQuery>();
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ws.ignore(pos, end);
......
......@@ -16,7 +16,7 @@ bool ParserOptimizeQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_optimize("OPTIMIZE", true, true);
ParserString s_table("TABLE", true, true);
ParserString s_partition("PARTITION", true, true);
......
......@@ -16,7 +16,7 @@ protected:
bool parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected) override;
protected:
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
};
}
......@@ -16,7 +16,7 @@ static bool parseDatabaseAndTable(
ASTRenameQuery::Table & db_and_table, IParser::Pos & pos, IParser::Pos end, IParser::Pos & max_parsed_pos, Expected & expected)
{
ParserIdentifier name_p;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_dot(".");
ASTPtr database;
......@@ -49,7 +49,7 @@ bool ParserRenameQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_p
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_rename("RENAME", true, true);
ParserString s_table("TABLE", true, true);
ParserString s_to("TO", true, true);
......
......@@ -12,7 +12,7 @@ namespace DB
static bool parseDecimal(IParser::Pos & pos, IParser::Pos end, ASTSampleRatio::Rational & res, IParser::Pos & max_parsed_pos)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ws.ignore(pos, end);
UInt64 num_before = 0;
......@@ -90,7 +90,7 @@ bool ParserSampleRatio::parseImpl(IParser::Pos & pos, IParser::Pos end, ASTPtr &
{
auto begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ASTSampleRatio::Rational numerator;
ASTSampleRatio::Rational denominator;
......
......@@ -28,7 +28,7 @@ bool ParserSelectQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_p
auto select_query = std::make_shared<ASTSelectQuery>();
node = select_query;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_select("SELECT", true, true);
ParserString s_distinct("DISTINCT", true, true);
ParserString s_from("FROM", true, true);
......
......@@ -17,7 +17,7 @@ static bool parseNameValuePair(ASTSetQuery::Change & change, IParser::Pos & pos,
{
ParserIdentifier name_p;
ParserLiteral value_p;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_eq("=");
ASTPtr name;
......@@ -51,7 +51,7 @@ bool ParserSetQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_pars
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_comma(",");
bool global = false;
......
......@@ -21,7 +21,7 @@ protected:
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_show("SHOW", true, true);
ParserString s_processlist("PROCESSLIST", true, true);
......
......@@ -17,7 +17,7 @@ bool ParserShowTablesQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & m
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_show("SHOW", true, true);
ParserString s_tables("TABLES", true, true);
ParserString s_databases("DATABASES", true, true);
......
......@@ -15,7 +15,7 @@ bool ParserTablePropertiesQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Po
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_exists("EXISTS", true, true);
ParserString s_describe("DESCRIBE", true, true);
ParserString s_desc("DESC", true, true);
......
......@@ -20,7 +20,7 @@ namespace ErrorCodes
bool ParserTableExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
auto res = std::make_shared<ASTTableExpression>();
ws.ignore(pos, end);
......@@ -92,7 +92,7 @@ bool ParserTableExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & m
bool ParserArrayJoin::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
auto res = std::make_shared<ASTArrayJoin>();
ws.ignore(pos, end);
......@@ -147,7 +147,7 @@ bool ParserArrayJoin::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_par
bool ParserTablesInSelectQueryElement::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected)
{
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
auto res = std::make_shared<ASTTablesInSelectQueryElement>();
ws.ignore(pos, end);
......
......@@ -13,7 +13,7 @@ bool ParserUseQuery::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_pars
{
Pos begin = pos;
ParserWhiteSpaceOrComments ws;
ParserWhitespaceOrComments ws;
ParserString s_use("USE", true, true);
ParserIdentifier name_p;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册