PVS/V547: viml/parser/expressions.c: Expression is always true

This commit is contained in:
Justin M. Keyes
2019-01-04 02:29:39 +01:00
parent 788ade1d29
commit 6abdc0aeec

View File

@@ -2845,30 +2845,32 @@ viml_pexpr_parse_no_paren_closing_error: {}
kvi_push(ast_stack, new_top_node_p); kvi_push(ast_stack, new_top_node_p);
want_node = kENodeOperator; want_node = kENodeOperator;
} else { } else {
if (want_node == kENodeValue) { switch (want_node) {
NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeNested); case kENodeValue: {
*top_node_p = cur_node; NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeNested);
kvi_push(ast_stack, &cur_node->children); *top_node_p = cur_node;
HL_CUR_TOKEN(NestingParenthesis); kvi_push(ast_stack, &cur_node->children);
} else if (want_node == kENodeOperator) { HL_CUR_TOKEN(NestingParenthesis);
if (prev_token.type == kExprLexSpacing) { break;
// For some reason "function (args)" is a function call, but }
// "(funcref) (args)" is not. AFAIR this somehow involves case kENodeOperator: {
// compatibility and Bram was commenting that this is if (prev_token.type == kExprLexSpacing) {
// intentionally inconsistent and he is not very happy with the // For some reason "function (args)" is a function call, but
// situation himself. // "(funcref) (args)" is not. AFAIR this somehow involves
if ((*top_node_p)->type != kExprNodePlainIdentifier // compatibility and Bram was commenting that this is
&& (*top_node_p)->type != kExprNodeComplexIdentifier // intentionally inconsistent and he is not very happy with the
&& (*top_node_p)->type != kExprNodeCurlyBracesIdentifier) { // situation himself.
OP_MISSING; if ((*top_node_p)->type != kExprNodePlainIdentifier
} && (*top_node_p)->type != kExprNodeComplexIdentifier
&& (*top_node_p)->type != kExprNodeCurlyBracesIdentifier) {
OP_MISSING;
}
}
NEW_NODE_WITH_CUR_POS(cur_node, kExprNodeCall);
ADD_OP_NODE(cur_node);
HL_CUR_TOKEN(CallingParenthesis);
break;
} }
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);
} }
want_node = kENodeValue; want_node = kENodeValue;
} }