MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _add_block_locals

Method _add_block_locals

modules/gdscript/gdscript_compiler.cpp:1879–1889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1877}
1878
1879List<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
1891void GDScriptCompiler::_clear_block_locals(CodeGen &codegen, const List<GDScriptCodeGenerator::Address> &p_locals) {
1892 for (const GDScriptCodeGenerator::Address &local : p_locals) {

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.65
push_backMethod · 0.45
add_localMethod · 0.45
get_datatypeMethod · 0.45

Tested by

no test coverage detected