Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r7edd5c1 r9e7236f4  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Apr 20 13:58:00 2022
    13 // Update Count     : 43
     12// Last Modified On : Wed Mar 16 15:01:00 2022
     13// Update Count     : 42
    1414//
    1515
     
    9393        };
    9494
    95         template<typename T>
    96         Getter<T> get() {
    97                 return Getter<T>{ *this };
    98         }
     95    template<typename T>
     96    Getter<T> get() {
     97        return Getter<T>{ *this };
     98    }
    9999
    100100        Label makeLabel(Statement * labelled, const ast::Label& label) {
     
    562562                for ( auto clause : node->clauses ) {
    563563                        stmt->clauses.push_back({{
    564                                         get<Expression>().accept1( clause->target_func ),
    565                                         get<Expression>().acceptL( clause->target_args ),
     564                                        get<Expression>().accept1( clause.target.func ),
     565                                        get<Expression>().acceptL( clause.target.args ),
    566566                                },
    567                                 get<Statement>().accept1( clause->stmt ),
    568                                 get<Expression>().accept1( clause->cond ),
     567                                get<Statement>().accept1( clause.stmt ),
     568                                get<Expression>().accept1( clause.cond ),
    569569                        });
    570570                }
    571571                stmt->timeout = {
    572                         get<Expression>().accept1( node->timeout_time ),
    573                         get<Statement>().accept1( node->timeout_stmt ),
    574                         get<Expression>().accept1( node->timeout_cond ),
     572                        get<Expression>().accept1( node->timeout.time ),
     573                        get<Statement>().accept1( node->timeout.stmt ),
     574                        get<Expression>().accept1( node->timeout.cond ),
    575575                };
    576576                stmt->orelse = {
    577                         get<Statement>().accept1( node->else_stmt ),
    578                         get<Expression>().accept1( node->else_cond ),
     577                        get<Statement>().accept1( node->orElse.stmt ),
     578                        get<Expression>().accept1( node->orElse.cond ),
    579579                };
    580580                return stmtPostamble( stmt, node );
    581         }
    582 
    583         const ast::WaitForClause * visit( const ast::WaitForClause * node ) override final {
    584                 // There is no old-AST WaitForClause, so this should never be called.
    585                 assert( !node );
    586                 return nullptr;
    587581        }
    588582
     
    16511645                        // GET_ACCEPT_1(type, FunctionType),
    16521646                        std::move(forall),
    1653                         std::move(assertions),
    16541647                        std::move(paramVars),
    16551648                        std::move(returnVars),
     
    16651658                cache.emplace( old, decl );
    16661659
     1660                decl->assertions = std::move(assertions);
    16671661                decl->withExprs = GET_ACCEPT_V(withExprs, Expr);
    16681662                decl->stmts = GET_ACCEPT_1(statements, CompoundStmt);
     
    21022096                stmt->clauses.reserve( old->clauses.size() );
    21032097                for (size_t i = 0 ; i < old->clauses.size() ; ++i) {
    2104                         auto clause = new ast::WaitForClause( old->location );
    2105 
    2106                         clause->target_func = GET_ACCEPT_1(clauses[i].target.function, Expr);
    2107                         clause->target_args = GET_ACCEPT_V(clauses[i].target.arguments, Expr);
    2108                         clause->stmt = GET_ACCEPT_1(clauses[i].statement, Stmt);
    2109                         clause->cond = GET_ACCEPT_1(clauses[i].condition, Expr);
    2110 
    2111                         stmt->clauses.push_back( clause );
    2112                 }
    2113                 stmt->timeout_time = GET_ACCEPT_1(timeout.time, Expr);
    2114                 stmt->timeout_stmt = GET_ACCEPT_1(timeout.statement, Stmt);
    2115                 stmt->timeout_cond = GET_ACCEPT_1(timeout.condition, Expr);
    2116                 stmt->else_stmt = GET_ACCEPT_1(orelse.statement, Stmt);
    2117                 stmt->else_cond = GET_ACCEPT_1(orelse.condition, Expr);
     2098                        stmt->clauses.push_back({
     2099                                ast::WaitForStmt::Target{
     2100                                        GET_ACCEPT_1(clauses[i].target.function, Expr),
     2101                                        GET_ACCEPT_V(clauses[i].target.arguments, Expr)
     2102                                },
     2103                                GET_ACCEPT_1(clauses[i].statement, Stmt),
     2104                                GET_ACCEPT_1(clauses[i].condition, Expr)
     2105                        });
     2106                }
     2107                stmt->timeout = {
     2108                        GET_ACCEPT_1(timeout.time, Expr),
     2109                        GET_ACCEPT_1(timeout.statement, Stmt),
     2110                        GET_ACCEPT_1(timeout.condition, Expr),
     2111                };
     2112                stmt->orElse = {
     2113                        GET_ACCEPT_1(orelse.statement, Stmt),
     2114                        GET_ACCEPT_1(orelse.condition, Expr),
     2115                };
    21182116
    21192117                this->node = stmt;
     
    27292727                        ty->forall.emplace_back(new ast::TypeInstType(param));
    27302728                        for (auto asst : param->assertions) {
    2731                                 ty->assertions.emplace_back(
    2732                                         new ast::VariableExpr(param->location, asst));
     2729                                ty->assertions.emplace_back(new ast::VariableExpr({}, asst));
    27332730                        }
    27342731                }
Note: See TracChangeset for help on using the changeset viewer.