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

Function IsNamespace

NULLC/Callbacks.cpp:126–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 namespaceStack.pop_back();
125}
126NamespaceInfo* IsNamespace(InplaceStr space)
127{
128 for(int i = namespaceStack.size() - 1; i >= 0; i--)
129 {
130 unsigned hash = currNamespace ? currNamespace->hash : 0;
131 if(i == 0)
132 {
133 if(currNamespace)
134 {
135 hash = StringHashContinue(hash, ".");
136 hash = StringHashContinue(hash, space.begin, space.end);
137 }else{
138 hash = GetStringHash(space.begin, space.end);
139 }
140 }else{
141 hash = namespaceStack[i]->hash;
142 hash = StringHashContinue(hash, ".");
143 hash = StringHashContinue(hash, space.begin, space.end);
144 }
145 for(unsigned k = 0; k < CodeInfo::namespaceInfo.size(); k++)
146 {
147 if(CodeInfo::namespaceInfo[k]->hash == hash)
148 return CodeInfo::namespaceInfo[k];
149 }
150 }
151 return NULL;
152}
153NamespaceInfo* GetCurrentNamespace()
154{
155 return currNamespace;

Callers 4

TypeBeginFunction · 0.85
ParseSelectTypeFunction · 0.85
ParseVariableFunction · 0.85
ParseTerminalFunction · 0.85

Calls 3

StringHashContinueFunction · 0.85
GetStringHashFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected