| 1877 | } |
| 1878 | |
| 1879 | List<GDScriptCodeGenerator::Address> GDScriptCompiler::_add_block_locals(CodeGen &codegen, const GDScriptParser::SuiteNode *p_block) { |
| 1880 | List<GDScriptCodeGenerator::Address> addresses; |
| 1881 | for (int i = 0; i < p_block->locals.size(); i++) { |
| 1882 | if (p_block->locals[i].type == GDScriptParser::SuiteNode::Local::PARAMETER || p_block->locals[i].type == GDScriptParser::SuiteNode::Local::FOR_VARIABLE) { |
| 1883 | // Parameters are added directly from function and loop variables are declared explicitly. |
| 1884 | continue; |
| 1885 | } |
| 1886 | addresses.push_back(codegen.add_local(p_block->locals[i].name, _gdtype_from_datatype(p_block->locals[i].get_datatype(), codegen.script))); |
| 1887 | } |
| 1888 | return addresses; |
| 1889 | } |
| 1890 | |
| 1891 | void GDScriptCompiler::_clear_block_locals(CodeGen &codegen, const List<GDScriptCodeGenerator::Address> &p_locals) { |
| 1892 | for (const GDScriptCodeGenerator::Address &local : p_locals) { |
nothing calls this directly
no test coverage detected