Removed/commented out some destructor stuff. It'll come back for defer
This commit is contained in:
@@ -321,8 +321,11 @@ std::string CGenerator::generate(NodeTree<ASTData>* from, NodeTree<ASTData>* enc
|
|||||||
continue;
|
continue;
|
||||||
if (typeDefinition->getDataRef()->scope.find("destruct") == typeDefinition->getDataRef()->scope.end())
|
if (typeDefinition->getDataRef()->scope.find("destruct") == typeDefinition->getDataRef()->scope.end())
|
||||||
continue;
|
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;
|
output += destructorString;
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
Hello Destructors!
|
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user