indenting

This commit is contained in:
vaclavt
2022-02-14 17:59:22 +01:00
parent e9b210a456
commit 68504eb090

View File

@@ -433,39 +433,39 @@ namespace usql {
// function call
if (token_typcol == TokenType::identifier && m_lexer.nextTokenType() == TokenType::open_paren) {
std::string function_name = m_lexer.consumeToken(TokenType::identifier).token_string;
std::vector<std::unique_ptr<Node>> pars;
std::string function_name = m_lexer.consumeToken(TokenType::identifier).token_string;
std::vector<std::unique_ptr<Node>> pars;
m_lexer.skipToken(TokenType::open_paren);
while (m_lexer.tokenType() != TokenType::close_paren && m_lexer.tokenType() != TokenType::eof) {
pars.push_back(parse_expression());
m_lexer.skipTokenOptional(TokenType::comma);
}
m_lexer.skipToken(TokenType::close_paren);
return std::make_unique<FunctionNode>(function_name, std::move(pars));
m_lexer.skipToken(TokenType::open_paren);
while (m_lexer.tokenType() != TokenType::close_paren && m_lexer.tokenType() != TokenType::eof) {
pars.push_back(parse_expression());
m_lexer.skipTokenOptional(TokenType::comma);
}
m_lexer.skipToken(TokenType::close_paren);
return std::make_unique<FunctionNode>(function_name, std::move(pars));
}
// numbers and strings
std::string tokenString = m_lexer.consumeToken().token_string;
if (token_typcol == TokenType::int_number)
return std::make_unique<IntValueNode>(std::stoi(tokenString));
return std::make_unique<IntValueNode>(std::stoi(tokenString));
if (token_typcol == TokenType::double_number)
return std::make_unique<DoubleValueNode>(std::stod(tokenString));
return std::make_unique<DoubleValueNode>(std::stod(tokenString));
if (token_typcol == TokenType::string_literal)
return std::make_unique<StringValueNode>(tokenString);
return std::make_unique<StringValueNode>(tokenString);
// db column
if (token_typcol == TokenType::identifier)
return std::make_unique<DatabaseValueNode>(tokenString);
return std::make_unique<DatabaseValueNode>(tokenString);
// null
if (token_typcol == TokenType::keyword_null)
return std::make_unique<NullValueNode>();
return std::make_unique<NullValueNode>();
// true / false
if (token_typcol == TokenType::keyword_true || token_typcol == TokenType::keyword_false)
return std::make_unique<BooleanValueNode>(token_typcol == TokenType::keyword_true);
return std::make_unique<BooleanValueNode>(token_typcol == TokenType::keyword_true);
// token * for count(*)
if (token_typcol == TokenType::multiply)