Fix comparsion logic

This commit is contained in:
NeZeD [Mac Pro] 2019-02-02 14:23:25 +03:00
parent 9265fb34a5
commit d605c9c104
No known key found for this signature in database
GPG Key ID: 15AF581A8B5439D7

View File

@ -260,8 +260,8 @@ bool ParserBetweenExpression::parseImpl(Pos & pos, ASTPtr & node, Expected & exp
is_not = true;
/// AND function
auto f_and = std::make_shared<ASTFunction>();
auto args_and = std::make_shared<ASTExpressionList>();
auto f_combined_expression = std::make_shared<ASTFunction>();
auto args_combined_expression = std::make_shared<ASTExpressionList>();
/// >=
auto f_ge = std::make_shared<ASTFunction>();
@ -285,14 +285,14 @@ bool ParserBetweenExpression::parseImpl(Pos & pos, ASTPtr & node, Expected & exp
f_le->arguments = args_le;
f_le->children.emplace_back(f_le->arguments);
args_and->children.emplace_back(f_ge);
args_and->children.emplace_back(f_le);
args_combined_expression->children.emplace_back(f_ge);
args_combined_expression->children.emplace_back(f_le);
f_and->name = "and";
f_and->arguments = args_and;
f_and->children.emplace_back(f_and->arguments);
f_combined_expression->name = is_not ? "or" : "and";
f_combined_expression->arguments = args_combined_expression;
f_combined_expression->children.emplace_back(f_combined_expression->arguments);
node = f_and;
node = args_combined_expression;
}
return true;