Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    rca78437 rc0aa336  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 14:59:41 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Jun 12 13:03:00 2017
    13 // Update Count     : 329
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Thu Feb  2 22:16:40 2017
     13// Update Count     : 327
    1414//
    1515
     
    152152        return new ReturnStmt( noLabels, exps.size() > 0 ? exps.back() : nullptr );
    153153}
    154 
    155154Statement *build_throw( ExpressionNode *ctl ) {
    156155        std::list< Expression * > exps;
    157156        buildMoveList( ctl, exps );
    158157        assertf( exps.size() < 2, "This means we are leaking memory");
    159         return new ThrowStmt( noLabels, ThrowStmt::Terminate, !exps.empty() ? exps.back() : nullptr );
    160 }
    161 
    162 Statement *build_resume( ExpressionNode *ctl ) {
    163         std::list< Expression * > exps;
    164         buildMoveList( ctl, exps );
    165         assertf( exps.size() < 2, "This means we are leaking memory");
    166         return new ThrowStmt( noLabels, ThrowStmt::Resume, !exps.empty() ? exps.back() : nullptr );
    167 }
    168 
    169 Statement *build_resume_at( ExpressionNode *ctl, ExpressionNode *target ) {
    170         std::list< Expression * > exps;
    171         buildMoveList( ctl, exps );
    172         assertf( exps.size() < 2, "This means we are leaking memory");
    173         return new ThrowStmt( noLabels, ThrowStmt::Resume, !exps.empty() ? exps.back() : nullptr );
     158        return new ReturnStmt( noLabels, !exps.empty() ? exps.back() : nullptr, true );
    174159}
    175160
     
    181166        return new TryStmt( noLabels, tryBlock, branches, finallyBlock );
    182167}
    183 Statement *build_catch( CatchStmt::Kind kind, DeclarationNode *decl, ExpressionNode *cond, StatementNode *body ) {
    184         std::list< Statement * > branches;
    185         buildMoveList< Statement, StatementNode >( body, branches );
    186         assert( branches.size() == 1 );
    187         return new CatchStmt( noLabels, kind, maybeMoveBuild< Declaration >(decl), maybeMoveBuild< Expression >(cond), branches.front() );
     168Statement *build_catch( DeclarationNode *decl, StatementNode *stmt, bool catchAny ) {
     169        std::list< Statement * > branches;
     170        buildMoveList< Statement, StatementNode >( stmt, branches );
     171        assert( branches.size() == 1 );
     172        return new CatchStmt( noLabels, maybeMoveBuild< Declaration >(decl), branches.front(), catchAny );
    188173}
    189174Statement *build_finally( StatementNode *stmt ) {
Note: See TracChangeset for help on using the changeset viewer.