src/ast/statement/stmtlist.cc
// TODO: reconcile insertSpecializedTypes() and insertSpecializedFunctions() -
// they are both very similar
reconcile insertSpecializedTypes() and insertSpecializedFunctions()
they are both very similar
reconcile insertSpecializedTypes () and insertSpecializedFunctions () they are both very similar
void
StmtListNode::insertSpecializedTypes(
    InstantiatedType* type,
    const vector<ClassDeclNode*>& classDecls) {
  ASTNode *node = type->getClassSymbolTable()->getOwner();
  VENOM_ASSERT_TYPEOF_PTR(ClassDeclNode, node);
  ClassDeclNode *classNode = static_cast<ClassDeclNode*>(node);
  StmtNodeVec::iterator pos =
    find(stmts.begin(), stmts.end(), classNode);
  assert(pos != stmts.end());
#ifndef NDEBUG
  for (vector<ClassDeclNode*>::const_iterator it = classDecls.begin();
       it != classDecls.end(); ++it) {
    assert((*it)->getInstantiationOfType());
    assert((*it)->getInstantiationOfType()
                ->getType()->equals(*type->getType()));
    assert((*it)->getSymbolTable() == symbols);
  }
#endif 
  stmts.insert(pos + 1, classDecls.begin(), classDecls.end()); 
  for (vector<ClassDeclNode*>::const_iterator it = classDecls.begin();
       it != classDecls.end(); ++it) {
    (*it)->setLocationContext(locCtx);
  }
}
void StmtListNode :: insertSpecializedTypes ( InstantiatedType * type , const vector < ClassDeclNode * > & classDecls ) { ASTNode * node = type -> getClassSymbolTable ( ) -> getOwner ( ) ; VENOM_ASSERT_TYPEOF_PTR ( ClassDeclNode , node ) ; ClassDeclNode * classNode = static_cast < ClassDeclNode * > ( node ) ; StmtNodeVec :: iterator pos = find ( stmts . begin ( ) , stmts . end ( ) , classNode ) ; assert ( pos != stmts . end ( ) ) ; #ifndef NDEBUG for ( vector < ClassDeclNode * > :: const_iterator it = classDecls . begin ( ) ; it != classDecls . end ( ) ; ++ it ) { assert ( ( * it ) -> getInstantiationOfType ( ) ) ; assert ( ( * it ) -> getInstantiationOfType ( ) -> getType ( ) -> equals ( * type -> getType ( ) ) ) ; assert ( ( * it ) -> getSymbolTable ( ) == symbols ) ; } #endif stmts . insert ( pos + 1 , classDecls . begin ( ) , classDecls . end ( ) ) ; for ( vector < ClassDeclNode * > :: const_iterator it = classDecls . begin ( ) ; it != classDecls . end ( ) ; ++ it ) { ( * it ) -> setLocationContext ( locCtx ) ; } }
TODO: reconcile insertSpecializedTypes() and insertSpecializedFunctions()
they are both very similar
TODO : reconcile insertSpecializedTypes () and insertSpecializedFunctions () they are both very similar
// assert the ClassDeclNodes actually belong here /* NDEBUG */ // insert after