I didn't save the file. Now most (all) class template tests fail. Bedtime.

This commit is contained in:
Nathan Braswell
2014-06-09 00:40:12 -07:00
parent 812d40c6db
commit 366bbb6432
3 changed files with 12 additions and 0 deletions

Binary file not shown.

View File

@@ -212,6 +212,18 @@ void ASTTransformation::fourthPass(NodeTree<ASTData>* ast, NodeTree<Symbol>* par
topScope = ast; //Top scope is maintained for templates, which need to add themselves to the top scope from where ever they are instantiated
std::vector<NodeTree<Symbol>*> children = parseTree->getChildren();
//First copy unfinished class templates into a new list and do them before anything else, so we know exactly which ones we need to do.
std::vector<NodeTree<ASTData>*> classTemplates;
for (auto i : ast->getDataRef()->scope)
if (i.second[0]->getDataRef()->type == type_def && i.second[0]->getDataRef()->valueType->baseType == template_type)
classTemplates.push_back(i.second[0]);
for (auto i : classTemplates) {
Type* classTemplateType = i->getDataRef()->valueType;
for (NodeTree<Symbol>* j : classTemplateType->templateDefinition->getChildren())
if (j->getDataRef()->getName() == "function")
fourthPassFunction(j, seachScopeForFunctionDef(i, j, classTemplateType->templateTypeReplacement), classTemplateType->templateTypeReplacement); //do member method
}
//Go through and finish both regular functions and class methods
//Note that this pass can instantiate class AND function templates
for (NodeTree<Symbol>* i : children) {