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

Function RestoreNamespaces

NULLC/Callbacks.cpp:3998–4017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3996 namespaceStack.push_back(info);
3997}
3998void RestoreNamespaces(bool undo, NamespaceInfo *parent, unsigned& prevBackupSize, unsigned& prevStackSize, NamespaceInfo*& lastNS)
3999{
4000 if(!undo)
4001 {
4002 prevBackupSize = namespaceBackup.size();
4003 prevStackSize = namespaceStack.size();
4004 if(namespaceStack.size() > 1)
4005 namespaceBackup.push_back(&namespaceStack[1], namespaceStack.size() - 1);
4006 namespaceStack.shrink(1);
4007 RestoreNamespaceStack(parent);
4008 lastNS = currNamespace;
4009 currNamespace = NULL;
4010 }else{
4011 namespaceStack.shrink(1);
4012 if(prevStackSize > 1)
4013 namespaceStack.push_back(&namespaceBackup[prevBackupSize], prevStackSize - 1);
4014 namespaceBackup.shrink(prevBackupSize);
4015 currNamespace = lastNS;
4016 }
4017}
4018
4019// Function expects that nodes with argument types are on top of nodeList
4020// Return node with function definition if there was one

Callers 3

EndBlockFunction · 0.85
TypeInstanceGenericFunction · 0.85

Calls 4

RestoreNamespaceStackFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45
shrinkMethod · 0.45

Tested by

no test coverage detected