Removed/commented out some destructor stuff. It'll come back for defer

This commit is contained in:
Nathan Braswell
2015-05-10 02:48:05 -04:00
parent 44d310c092
commit d70fa4ebbb
3 changed files with 5 additions and 31 deletions

View File

@@ -321,8 +321,11 @@ std::string CGenerator::generate(NodeTree<ASTData>* from, NodeTree<ASTData>* enc
continue;
if (typeDefinition->getDataRef()->scope.find("destruct") == typeDefinition->getDataRef()->scope.end())
continue;
destructorString += tabs() + scopePrefix(from) + CifyName(typeDefinition->getDataRef()->symbol.getName())
+ "__" + "destruct" + "(&" + generate(identifier, enclosingObject) + ");\n";//Call the destructor
// ***************************************************************************************
// I've decided not to do the destructor thing. This will come back soon for defer though!
// ***************************************************************************************
//destructorString += tabs() + scopePrefix(from) + CifyName(typeDefinition->getDataRef()->symbol.getName())
//+ "__" + "destruct" + "(&" + generate(identifier, enclosingObject) + ");\n";//Call the destructor
}
}
output += destructorString;

View File

@@ -1 +0,0 @@
Hello Destructors!

View File

@@ -1,28 +0,0 @@
import io:*;
typedef DestructorPrint {
var myStr: char*;
fun construct(str: char*): DestructorPrint* {
myStr = str;
return this;
}
fun destruct(): void {
println(myStr);
}
};
typedef NoDistruction {
var a: int;
fun dummyFunc(): void {}
};
fun indirPrint(): void {
var testObj.construct("Hello Destructors!"): DestructorPrint;
var dummy: NoDistruction;
}
fun main(): int {
indirPrint();
return 0;
}