MCPcopy Create free account
hub / github.com/WheretIB/nullc / ImportEnd

Function ImportEnd

Colorer.cpp:285–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283 return (ByteCode*)nullcGetModule(name);
284 }
285 void ImportEnd(char const* s, char const* e)
286 {
287 (void)s; (void)e; // C4100
288 importPath.append(".nc");
289 ByteCode *code = (ByteCode*)nullcGetModule(importPath.c_str());
290 if(!code && (code = BuildModule(importPath.c_str())) == NULL)
291 {
292 logStream << "ERROR: can't find module '" << importPath << "'\r\n";
293 }else{
294 ExternTypeInfo *tInfo = FindFirstType(code);
295 const char *symbols = (char*)(code) + code->offsetToSymbols;
296 for(unsigned int i = 0; i < code->typeCount; i++, tInfo++)
297 {
298 if(tInfo->subCat != ExternTypeInfo::CAT_CLASS)
299 continue;
300 bool found = false;
301 for(unsigned int n = 0; n < typeInfo.size() && !found; n++)
302 {
303 if(tInfo->nameHash == typeInfo[n])
304 found = true;
305 }
306 if(found)
307 continue;
308 const char *typeName = symbols + tInfo->offsetToName;
309 typeInfo.push_back(GetStringHash(typeName));
310 while((typeName = strchr(typeName, '.')) != NULL)
311 {
312 typeName++;
313 typeInfo.push_back(GetStringHash(typeName));
314 }
315 }
316 struct NamespaceData
317 {
318 unsigned offsetToName;
319 unsigned parentHash;
320 };
321 NamespaceData *namespaceList = (NamespaceData*)((char*)code + code->offsetToNamespaces);
322 for(unsigned i = 0; i < code->namespaceCount; i++)
323 {
324 typeInfo.push_back(GetStringHash(symbols + namespaceList->offsetToName));
325 namespaceList++;
326 }
327 }
328 }
329
330 void StartType(char const* s, char const* e)
331 {

Callers

nothing calls this directly

Calls 9

nullcGetModuleFunction · 0.85
BuildModuleFunction · 0.85
FindFirstTypeFunction · 0.85
strchrFunction · 0.85
c_strMethod · 0.80
GetStringHashFunction · 0.50
appendMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected