diff options
Diffstat (limited to 'src/shared/cplusplus/ASTClone.cpp')
-rw-r--r-- | src/shared/cplusplus/ASTClone.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shared/cplusplus/ASTClone.cpp b/src/shared/cplusplus/ASTClone.cpp index c3eb1ab40f..2e446c89ef 100644 --- a/src/shared/cplusplus/ASTClone.cpp +++ b/src/shared/cplusplus/ASTClone.cpp @@ -514,6 +514,23 @@ FunctionDefinitionAST *FunctionDefinitionAST::clone(MemoryPool *pool) const return ast; } +ForeachStatementAST *ForeachStatementAST::clone(MemoryPool *pool) const +{ + ForeachStatementAST *ast = new (pool) ForeachStatementAST; + // copy StatementAST + // copy ForeachStatementAST + ast->foreach_token = foreach_token; + ast->lparen_token = lparen_token; + if (type_specifiers) ast->type_specifiers = type_specifiers->clone(pool); + if (declarator) ast->declarator = declarator->clone(pool); + if (initializer) ast->initializer = initializer->clone(pool); + ast->comma_token = comma_token; + if (expression) ast->expression = expression->clone(pool); + ast->rparen_token = rparen_token; + if (statement) ast->statement = statement->clone(pool); + return ast; +} + ForStatementAST *ForStatementAST::clone(MemoryPool *pool) const { ForStatementAST *ast = new (pool) ForStatementAST; |