Fix middle expression of for
loop to accept not only operators
This commit is contained in:
parent
33c30b9e63
commit
3272f00525
1 changed files with 3 additions and 3 deletions
|
@ -8061,7 +8061,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun
|
|||
if (!expr) {
|
||||
return ERR_PARSE_ERROR;
|
||||
}
|
||||
is_condition = expr->type == Node::NODE_TYPE_OPERATOR && expr->get_datatype() == TYPE_BOOL;
|
||||
is_condition = expr->get_datatype() == TYPE_BOOL;
|
||||
|
||||
if (expr->type == Node::NODE_TYPE_OPERATOR) {
|
||||
OperatorNode *op = static_cast<OperatorNode *>(expr);
|
||||
|
@ -8077,7 +8077,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun
|
|||
if (p_block->block_type == BlockNode::BLOCK_TYPE_FOR_CONDITION) {
|
||||
if (tk.type == TK_COMMA) {
|
||||
if (!is_condition) {
|
||||
_set_error(RTR("The middle expression is expected to be a boolean operator."));
|
||||
_set_error(RTR("The middle expression is expected to have a boolean data type."));
|
||||
return ERR_PARSE_ERROR;
|
||||
}
|
||||
continue;
|
||||
|
@ -8106,7 +8106,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const FunctionInfo &p_fun
|
|||
return ERR_PARSE_ERROR;
|
||||
}
|
||||
if (p_block->block_type == BlockNode::BLOCK_TYPE_FOR_CONDITION && !is_condition) {
|
||||
_set_error(RTR("The middle expression is expected to be a boolean operator."));
|
||||
_set_error(RTR("The middle expression is expected to have a boolean data type."));
|
||||
return ERR_PARSE_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue