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

Method addModule

src/ast/ast_module.cpp:971–992  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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>))");
973 if ( module ) {
974 thisModule = thisModule ? thisModule : module;
975 if ( find(modules.begin(),modules.end(),module)==modules.end() ) {
976 for ( auto dep : ordered(module->requireModule, [](auto m1, auto m2){ return m1->name < m2->name; }) ) {
977 if ( dep.first != module ) {
978 addModule ( dep.first );
979 }
980 }
981 modules.push_back(module);
982 if ( moduleLookupByHash.find(module->nameHash)!=moduleLookupByHash.end() ) {
983 modules.pop_back();
984 return false;
985 }
986 moduleLookupByHash[module->nameHash] = module;
987 module->addPrerequisits(*this);
988 return true;
989 }
990 }
991 return false;
992 }
993
994 void ModuleLibrary::foreach ( const callable<bool (Module * module)> & func, const string & moduleName ) const {
995 DAS_ASSERT(moduleName!="_" && moduleName!="__");

Callers 15

Module_PUGIXMLMethod · 0.45
Module_StdDlgMethod · 0.45
Module_HVMethod · 0.45
initDependenciesMethod · 0.45
initDependenciesMethod · 0.45
initDependenciesMethod · 0.45
Module_MinfftMethod · 0.45
Module_StbTrueTypeMethod · 0.45
Module_StbImageMethod · 0.45
addNewModulesFunction · 0.45
transform_syntaxFunction · 0.45
ast_requireModuleFunction · 0.45

Calls 6

orderedFunction · 0.85
findFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected