diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index cf2a01c07c6..300c38db22b 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -5070,6 +5070,10 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Mapvariables[name] = var; if (tk.type == TK_COMMA) { + if (p_block->block_type == BlockNode::BLOCK_TYPE_FOR) { + _set_error("Multiple declarations in 'for' loop are not implemented yet."); + return ERR_PARSE_ERROR; + } tk = _get_token(); //another variable } else if (tk.type == TK_SEMICOLON) { @@ -5394,6 +5398,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Mapflow_op = FLOW_OP_FOR; BlockNode *init_block = alloc_node(); + init_block->block_type = BlockNode::BLOCK_TYPE_FOR; init_block->parent_block = p_block; init_block->single_statement = true; cf->blocks.push_back(init_block); diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index bdc15cc4aa9..9124bee633b 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -487,6 +487,7 @@ public: enum BlockType { BLOCK_TYPE_STANDART, + BLOCK_TYPE_FOR, BLOCK_TYPE_SWITCH, BLOCK_TYPE_CASE, BLOCK_TYPE_DEFAULT,