mirror of
https://github.com/pantor/inja.git
synced 2026-06-05 02:19:45 +00:00
Switched order in token::kind::id of function and operator behavior (#155)
* switched order in token::kind::id of function and operator behavior * add tests Co-authored-by: pantor <lars.berscheid@online.de>
This commit is contained in:
@@ -139,14 +139,14 @@ class Parser {
|
||||
add_json_literal(tmpl.content.c_str());
|
||||
}
|
||||
|
||||
// Operator
|
||||
} else if (tok.text == "and" || tok.text == "or" || tok.text == "in" || tok.text == "not") {
|
||||
goto parse_operator;
|
||||
|
||||
// Functions
|
||||
} else if (peek_tok.kind == Token::Kind::LeftParen) {
|
||||
operator_stack.emplace(std::make_shared<FunctionNode>(static_cast<std::string>(tok.text), tok.text.data() - tmpl.content.c_str()));
|
||||
function_stack.emplace(operator_stack.top().get(), current_paren_level);
|
||||
|
||||
// Operator
|
||||
} else if (tok.text == "and" || tok.text == "or" || tok.text == "in" || tok.text == "not") {
|
||||
goto parse_operator;
|
||||
function_stack.emplace(operator_stack.top().get(), current_paren_level);
|
||||
|
||||
// Variables
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user