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

Method compileBuiltinModule

src/ast/ast_module.cpp:814–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

812 }
813
814 bool Module::compileBuiltinModule ( const string & modName, const unsigned char * const str, unsigned int str_len ) {
815 TextWriter issues;
816 auto access = make_smart<FileAccess>();
817 auto fileInfo = make_unique<TextFileInfo>((char *) str, uint32_t(str_len), false);
818 access->setFileInfo(modName, das::move(fileInfo));
819 ModuleGroup dummyLibGroup;
820 auto program = parseDaScript(modName, "", access, issues, dummyLibGroup, true);
821 ownFileInfo = access->letGoOfFileInfo(modName);
822 DAS_ASSERTF(ownFileInfo,"something went wrong and FileInfo for builtin module can not be obtained");
823 auto result = appendBuiltinModuleContent(this, program, modName);
824 program->thisModule->module_gc_root->gc_dump_to_thread_root();
825 return result;
826 }
827
828 bool isValidBuiltinName ( const string & name, bool canPunkt ) {
829 if ( name.size()>=2 && name[0]=='.' && name[1]=='`') { // any name starting with .` is ok

Callers

nothing calls this directly

Calls 5

parseDaScriptFunction · 0.85
setFileInfoMethod · 0.80
letGoOfFileInfoMethod · 0.80

Tested by

no test coverage detected