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

Function addRequirements

src/ast/ast_parse.cpp:263–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261 }
262
263 bool addRequirements(const string & fileName, ModuleGroup & libGroup, Module * mod, int32_t line, const FileAccessPtr & access,
264 vector<RequireRecord> & notAllowed, vector<FileInfo*> & chain, TextWriter * log, int tab ) {
265 if ( !access->isModuleAllowed(mod->name, fileName) ) {
266 notAllowed.push_back({mod->name, line, chain});
267 if ( log ) {
268 *log << string(tab,'\t') << "dependency " << mod->name << " - NOT ALLOWED\n";
269 }
270 return false;
271 } else {
272 if ( log ) {
273 *log << string(tab,'\t') << "add dependency " << mod->name << "\n";
274 }
275 if ( libGroup.addModule(mod) ) {
276 tab ++;
277 for ( auto & dep : ordered(mod->requireModule,
278 [](const auto &m1, const auto &m2) {
279 return m1->name < m2->name;
280 }) ) {
281 chain.push_back(dep.first->getFileInfo());
282 if ( !addRequirements(fileName, libGroup, dep.first, line, access, notAllowed, chain, log, tab) ) {
283 chain.pop_back();
284 return false;
285 }
286 chain.pop_back();
287 }
288 tab --;
289 }
290 return true;
291 }
292 }
293
294 string getDasRoot ( void );
295

Callers 1

getPrerequisitsFunction · 0.85

Calls 6

stringClass · 0.85
orderedFunction · 0.85
isModuleAllowedMethod · 0.45
push_backMethod · 0.45
addModuleMethod · 0.45
getFileInfoMethod · 0.45

Tested by

no test coverage detected