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

Function TypeContinue

NULLC/Callbacks.cpp:5061–5085  ·  view source on GitHub ↗

Before we add member function outside of the class definition, we should imitate that we're inside class definition

Source from the content-addressed store, hash-verified

5059
5060// Before we add member function outside of the class definition, we should imitate that we're inside class definition
5061void TypeContinue(const char* pos)
5062{
5063 if(newType)
5064 ThrowError(pos, "ERROR: cannot continue type '%s' definition inside '%s' type. Possible cause: external member function definition syntax inside a class", currType->GetFullTypeName(), newType->GetFullTypeName());
5065 newType = currType;
5066 newType->definitionDepth = varInfoTop.size();
5067 // Add all member variables to global scope
5068 BeginBlock();
5069 for(TypeInfo::MemberVariable *curr = newType->firstVariable; curr; curr = curr->next)
5070 {
5071 currType = curr->type;
5072 currAlign = 4;
5073 VariableInfo *varInfo = (VariableInfo*)AddVariable(pos, InplaceStr(curr->name), false);
5074 varInfo->isGlobal = true;
5075 varInfo->parentType = newType;
5076 varDefined = false;
5077 }
5078 // Restore all type aliases defined inside a class
5079 AliasInfo *info = newType->childAlias;
5080 while(info)
5081 {
5082 CodeInfo::classMap.insert(info->nameHash, info->type);
5083 info = info->next;
5084 }
5085}
5086
5087// End of outside class member definition
5088void TypeStop()

Callers 4

EndBlockFunction · 0.85
ParseFunctionDefinitionFunction · 0.85
ParseCustomConstructorFunction · 0.85

Calls 7

ThrowErrorFunction · 0.85
BeginBlockFunction · 0.85
AddVariableFunction · 0.85
InplaceStrClass · 0.85
GetFullTypeNameMethod · 0.80
insertMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected