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

Method GetScopeFromNode

sdk/angelscript/source/as_builder.cpp:6068–6100  ·  view source on GitHub ↗

TODO: child funcdef: Should try to eliminate this function. GetNameSpaceFromNode is more complete

Source from the content-addressed store, hash-verified

6066
6067// TODO: child funcdef: Should try to eliminate this function. GetNameSpaceFromNode is more complete
6068asCString asCBuilder::GetScopeFromNode(asCScriptNode *node, asCScriptCode *script, asCScriptNode **next)
6069{
6070 if (node->nodeType != snScope)
6071 {
6072 if (next)
6073 *next = node;
6074 return "";
6075 }
6076
6077 asCString scope;
6078 asCScriptNode *sn = node->firstChild;
6079 if( sn->tokenType == ttScope )
6080 {
6081 scope = "::";
6082 sn = sn->next;
6083 }
6084
6085 // TODO: child funcdef: A scope can have a template type as the innermost
6086 while( sn && sn->next && sn->next->tokenType == ttScope )
6087 {
6088 asCString tmp;
6089 tmp.Assign(&script->code[sn->tokenPos], sn->tokenLength);
6090 if( scope != "" && scope != "::" )
6091 scope += "::";
6092 scope += tmp;
6093 sn = sn->next->next;
6094 }
6095
6096 if( next )
6097 *next = node->next;
6098
6099 return scope;
6100}
6101
6102bool asCBuilder::FindObjectTypeOrMixinInNsHierarchy(const asCString& name, asSNameSpace* startNs, bool isExplicitNs, asCScriptNode *errNode, asCScriptCode *script, asCObjectType **outObjType, sMixinClass **outMixin)
6103{

Callers 1

Calls 1

AssignMethod · 0.80

Tested by

no test coverage detected