mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00
PVS/V547: viml/parser/expressions.c: Expression is always true
This commit is contained in:
@@ -2845,12 +2845,15 @@ viml_pexpr_parse_no_paren_closing_error: {}
|
||||
kvi_push(ast_stack, new_top_node_p);
|
||||
want_node = kENodeOperator;
|
||||
} else {
|
||||
if (want_node == kENodeValue) {
|
||||
switch (want_node) {
|
||||
case kENodeValue: {
|
||||
NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeNested);
|
||||
*top_node_p = cur_node;
|
||||
kvi_push(ast_stack, &cur_node->children);
|
||||
HL_CUR_TOKEN(NestingParenthesis);
|
||||
} else if (want_node == kENodeOperator) {
|
||||
break;
|
||||
}
|
||||
case kENodeOperator: {
|
||||
if (prev_token.type == kExprLexSpacing) {
|
||||
// For some reason "function (args)" is a function call, but
|
||||
// "(funcref) (args)" is not. AFAIR this somehow involves
|
||||
@@ -2866,9 +2869,8 @@ viml_pexpr_parse_no_paren_closing_error: {}
|
||||
NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeCall);
|
||||
ADD_OP_NODE(cur_node);
|
||||
HL_CUR_TOKEN(CallingParenthesis);
|
||||
} else {
|
||||
// Currently it is impossible to reach this.
|
||||
assert(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
want_node = kENodeValue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user