Changes in src/AST/Convert.cpp [561354f:c86b08d]
- File:
-
- 1 edited
-
src/AST/Convert.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r561354f rc86b08d 283 283 decl->parent = get<AggregateDecl>().accept1( node->parent ); 284 284 declPostamble( decl, node ); 285 return nullptr; 285 return nullptr; // ?? 286 286 } 287 287 … … 320 320 LinkageSpec::Spec( node->linkage.val ), 321 321 get<Type>().accept1(node->base) 322 );323 // decl->data_constructors = get<StructDecl>().acceptL( node->data_constructors );324 // decl->data_union = get<UnionDecl>().accept1( node->data_union );325 // decl->tag = get<EnumDecl>().accept1( node->tag );326 // decl->tag_union = get<StructDecl>().accept1( node->tag_union );327 return aggregatePostamble( decl, node );328 }329 330 const ast::Decl * visit( const ast::AdtDecl * node ) override final {331 if ( inCache(node) ) return nullptr;332 auto decl = new AdtDecl(333 node->name,334 get<Attribute>().acceptL( node->attributes ),335 LinkageSpec::Spec( node->linkage.val ),336 get<StructDecl>().acceptL( node->data_constructors ),337 get<UnionDecl>().accept1( node->data_union ),338 get<EnumDecl>().accept1( node->tag ),339 get<StructDecl>().accept1( node->tag_union )340 322 ); 341 323 return aggregatePostamble( decl, node ); … … 577 559 auto stmt = new SuspendStmt(); 578 560 stmt->then = get<CompoundStmt>().accept1( node->then ); 579 switch (node->kind) {561 switch(node->type) { 580 562 case ast::SuspendStmt::None : stmt->type = SuspendStmt::None ; break; 581 563 case ast::SuspendStmt::Coroutine: stmt->type = SuspendStmt::Coroutine; break; … … 583 565 } 584 566 return stmtPostamble( stmt, node ); 567 } 568 569 const ast::WhenClause * visit( const ast::WhenClause * node ) override final { 570 // There is no old-AST WhenClause, so this should never be called. 571 assert( !node ); 572 return nullptr; 585 573 } 586 574 … … 591 579 for ( auto clause : node->clauses ) { 592 580 stmt->clauses.push_back({{ 593 get<Expression>().accept1( clause->target _func),581 get<Expression>().accept1( clause->target ), 594 582 get<Expression>().acceptL( clause->target_args ), 595 583 }, 596 584 get<Statement>().accept1( clause->stmt ), 597 get<Expression>().accept1( clause-> cond ),585 get<Expression>().accept1( clause->when_cond ), 598 586 }); 599 587 } … … 612 600 const ast::WaitForClause * visit( const ast::WaitForClause * node ) override final { 613 601 // There is no old-AST WaitForClause, so this should never be called. 602 assert( !node ); 603 return nullptr; 604 } 605 606 const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final { 607 // There is no old-AST WaitUntilStmt, so this should never be called. 614 608 assert( !node ); 615 609 return nullptr; … … 1701 1695 GET_ACCEPT_V(attributes, Attribute), 1702 1696 { old->get_funcSpec().val }, 1703 (old->type->isVarArgs) ? ast::VariableArgs : ast::FixedArgs1697 old->type->isVarArgs 1704 1698 }; 1705 1699 … … 1793 1787 decl->uniqueId = old->uniqueId; 1794 1788 decl->storage = { old->storageClasses.val }; 1795 this->node = decl;1796 }1797 1798 virtual void visit( const AdtDecl * old ) override final {1799 if ( inCache( old ) ) return;1800 auto decl = new ast::AdtDecl(1801 old->location,1802 old->name,1803 GET_ACCEPT_V(attributes, Attribute),1804 { old->linkage.val }1805 );1806 cache.emplace( old, decl );1807 decl->parent = GET_ACCEPT_1(parent, AggregateDecl);1808 decl->body = old->body;1809 decl->params = GET_ACCEPT_V(parameters, TypeDecl);1810 decl->members = GET_ACCEPT_V(members, Decl);1811 decl->extension = old->extension;1812 decl->uniqueId = old->uniqueId;1813 decl->storage = { old->storageClasses.val };1814 decl->data_constructors = GET_ACCEPT_V( data_constructors, StructDecl );1815 decl->data_union = GET_ACCEPT_1( data_union, UnionDecl );1816 decl->tag = GET_ACCEPT_1( tag, EnumDecl );1817 decl->tag_union = GET_ACCEPT_1( tag_union, StructDecl );1818 1789 this->node = decl; 1819 1790 } … … 2030 2001 GET_ACCEPT_1(else_, Stmt), 2031 2002 GET_ACCEPT_V(initialization, Stmt), 2032 (old->isDoWhile) ? ast::DoWhile : ast::While,2003 old->isDoWhile, 2033 2004 GET_LABELS_V(old->labels) 2034 2005 ); … … 2172 2143 virtual void visit( const SuspendStmt * old ) override final { 2173 2144 if ( inCache( old ) ) return; 2174 ast::SuspendStmt:: Kindtype;2145 ast::SuspendStmt::Type type; 2175 2146 switch (old->type) { 2176 2147 case SuspendStmt::Coroutine: type = ast::SuspendStmt::Coroutine; break; … … 2199 2170 auto clause = new ast::WaitForClause( old->location ); 2200 2171 2201 clause->target _func= GET_ACCEPT_1(clauses[i].target.function, Expr);2172 clause->target = GET_ACCEPT_1(clauses[i].target.function, Expr); 2202 2173 clause->target_args = GET_ACCEPT_V(clauses[i].target.arguments, Expr); 2203 2174 clause->stmt = GET_ACCEPT_1(clauses[i].statement, Stmt); 2204 clause-> cond = GET_ACCEPT_1(clauses[i].condition, Expr);2175 clause->when_cond = GET_ACCEPT_1(clauses[i].condition, Expr); 2205 2176 2206 2177 stmt->clauses.push_back( clause );
Note:
See TracChangeset
for help on using the changeset viewer.