Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r561354f rc86b08d  
    283283                decl->parent = get<AggregateDecl>().accept1( node->parent );
    284284                declPostamble( decl, node );
    285                 return nullptr;
     285                return nullptr; // ??
    286286        }
    287287
     
    320320                        LinkageSpec::Spec( node->linkage.val ),
    321321                        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 )
    340322                );
    341323                return aggregatePostamble( decl, node );
     
    577559                auto stmt = new SuspendStmt();
    578560                stmt->then   = get<CompoundStmt>().accept1( node->then   );
    579                 switch (node->kind) {
     561                switch(node->type) {
    580562                        case ast::SuspendStmt::None     : stmt->type = SuspendStmt::None     ; break;
    581563                        case ast::SuspendStmt::Coroutine: stmt->type = SuspendStmt::Coroutine; break;
     
    583565                }
    584566                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;
    585573        }
    586574
     
    591579                for ( auto clause : node->clauses ) {
    592580                        stmt->clauses.push_back({{
    593                                         get<Expression>().accept1( clause->target_func ),
     581                                        get<Expression>().accept1( clause->target ),
    594582                                        get<Expression>().acceptL( clause->target_args ),
    595583                                },
    596584                                get<Statement>().accept1( clause->stmt ),
    597                                 get<Expression>().accept1( clause->cond ),
     585                                get<Expression>().accept1( clause->when_cond ),
    598586                        });
    599587                }
     
    612600        const ast::WaitForClause * visit( const ast::WaitForClause * node ) override final {
    613601                // 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.
    614608                assert( !node );
    615609                return nullptr;
     
    17011695                        GET_ACCEPT_V(attributes, Attribute),
    17021696                        { old->get_funcSpec().val },
    1703                         (old->type->isVarArgs) ? ast::VariableArgs : ast::FixedArgs
     1697                        old->type->isVarArgs
    17041698                };
    17051699
     
    17931787                decl->uniqueId   = old->uniqueId;
    17941788                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 );
    18181789                this->node = decl;
    18191790        }
     
    20302001                        GET_ACCEPT_1(else_, Stmt),
    20312002                        GET_ACCEPT_V(initialization, Stmt),
    2032                         (old->isDoWhile) ? ast::DoWhile : ast::While,
     2003                        old->isDoWhile,
    20332004                        GET_LABELS_V(old->labels)
    20342005                );
     
    21722143        virtual void visit( const SuspendStmt * old ) override final {
    21732144                if ( inCache( old ) ) return;
    2174                 ast::SuspendStmt::Kind type;
     2145                ast::SuspendStmt::Type type;
    21752146                switch (old->type) {
    21762147                        case SuspendStmt::Coroutine: type = ast::SuspendStmt::Coroutine; break;
     
    21992170                        auto clause = new ast::WaitForClause( old->location );
    22002171
    2201                         clause->target_func = GET_ACCEPT_1(clauses[i].target.function, Expr);
     2172                        clause->target = GET_ACCEPT_1(clauses[i].target.function, Expr);
    22022173                        clause->target_args = GET_ACCEPT_V(clauses[i].target.arguments, Expr);
    22032174                        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);
    22052176
    22062177                        stmt->clauses.push_back( clause );
Note: See TracChangeset for help on using the changeset viewer.