MCPcopy Create free account
hub / github.com/anjo76/angelscript / FindNextVisibleNamespace

Method FindNextVisibleNamespace

sdk/angelscript/source/as_builder.cpp:932–954  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

930}
931
932asSNameSpace *asCBuilder::FindNextVisibleNamespace(const asCArray<asSNameSpace*>& visited, asCArray<asSNameSpace*>& pending, asSNameSpace *parentNs, bool* checkAmbiguous)
933{
934 // First iterate through all pending namespaces that have been included with 'using namespace'
935 asSNameSpace* nextNs = 0;
936 while ( pending.GetLength() != 0 )
937 {
938 asSNameSpace *candidate = pending.PopLast();
939 if (!visited.Exists(candidate))
940 {
941 nextNs = candidate;
942 break;
943 }
944 }
945
946 // Even if the parent namespace has already been visited, it still needs to be traversed
947 if (nextNs == 0)
948 nextNs = parentNs;
949
950 if (checkAmbiguous && !(*checkAmbiguous))
951 *checkAmbiguous = nextNs == engine->nameSpaces[0];
952
953 return nextNs;
954}
955
956#ifndef AS_NO_COMPILER
957void asCBuilder::RegisterNonTypesFromScript(asCScriptNode *node, asCScriptCode *script, asSNameSpace *ns)

Callers 1

SymbolLookupMethod · 0.80

Calls 3

PopLastMethod · 0.80
GetLengthMethod · 0.45
ExistsMethod · 0.45

Tested by

no test coverage detected