Chain class instance constructors with arguments.

This commit is contained in:
Stephen Williams
2013-11-10 18:03:19 -08:00
parent 0157a156fb
commit d192f545ac
13 changed files with 144 additions and 19 deletions
+15
View File
@@ -19,6 +19,7 @@
# include "config.h"
# include "PTask.h"
# include "Statement.h"
# include <cassert>
PFunction::PFunction(perm_string name, LexicalScope*parent, bool is_auto__)
@@ -43,3 +44,17 @@ void PFunction::set_return(const data_type_t*t)
{
return_type_ = t;
}
PChainConstructor* PFunction::extract_chain_constructor()
{
PChainConstructor*res = 0;
if (res = dynamic_cast<PChainConstructor*> (statement_)) {
statement_ = 0;
} else if (PBlock*blk = dynamic_cast<PBlock*>(statement_)) {
res = blk->extract_chain_constructor();
}
return res;
}