clickhouse: fixed parsing lambda expressions [#CONV-7444].

This commit is contained in:
Michael Kolupaev 2013-05-08 10:59:21 +00:00
parent 4a19d688dd
commit c7ecc266c6

View File

@ -215,17 +215,24 @@ bool ParserLambdaExpression::parseImpl(Pos & pos, Pos end, ASTPtr & node, String
ASTPtr inner_arguments; ASTPtr inner_arguments;
ASTPtr expression; ASTPtr expression;
if (!open.ignore(pos, end, expected)) bool was_open = false;
break;
ws.ignore(pos, end, expected); if (open.ignore(pos, end, expected))
{
ws.ignore(pos, end, expected);
was_open = true;
}
if (!ParserList(new ParserIdentifier, new ParserString(",")).parse(pos, end, inner_arguments, expected)) if (!ParserList(new ParserIdentifier, new ParserString(",")).parse(pos, end, inner_arguments, expected))
break; break;
ws.ignore(pos, end, expected); ws.ignore(pos, end, expected);
if (!close.ignore(pos, end, expected)) if (was_open)
break; {
ws.ignore(pos, end, expected); if (!close.ignore(pos, end, expected))
break;
ws.ignore(pos, end, expected);
}
if (!arrow.ignore(pos, end, expected)) if (!arrow.ignore(pos, end, expected))
break; break;