MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / renameModule

Method renameModule

src/ast/ast_module.cpp:962–969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

960 }
961
962 void ModuleLibrary::renameModule ( Module * module, const string & newName ) {
963 auto oldHashLookup = moduleLookupByHash.find(module->nameHash);
964 DAS_VERIFYF(oldHashLookup!=moduleLookupByHash.end(), "module %s not found", module->name.c_str());
965 moduleLookupByHash.erase(oldHashLookup);
966 module->setModuleName(newName);
967 DAS_VERIFYF(moduleLookupByHash.find(module->nameHash)==moduleLookupByHash.end(), "duplicate module hash %s", module->name.c_str());
968 moduleLookupByHash[module->nameHash] = module;
969 }
970
971 bool ModuleLibrary::addModule ( Module * module ) {
972 DAS_ASSERTF(module, "module not found? or you have forgotten to NEED_MODULE(Module_<name>) be called first before addModule(require(<name>))");

Callers 5

yyparseFunction · 0.80
yyparseFunction · 0.80
yyparseFunction · 0.80
parseDaScriptFunction · 0.80
compileDaScriptFunction · 0.80

Calls 5

setModuleNameMethod · 0.80
findMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected