Changes in src/Parser/StatementNode.cc [ca78437:c0aa336]
- File:
- 
      - 1 edited
 
 - 
          
  src/Parser/StatementNode.cc (modified) (3 diffs)
 
Legend:
- Unmodified
- Added
- Removed
- 
      src/Parser/StatementNode.ccrca78437 rc0aa336 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 14:59:41 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Jun 12 13:03:00 201713 // Update Count : 32 911 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 2 22:16:40 2017 13 // Update Count : 327 14 14 // 15 15 … … 152 152 return new ReturnStmt( noLabels, exps.size() > 0 ? exps.back() : nullptr ); 153 153 } 154 155 154 Statement *build_throw( ExpressionNode *ctl ) { 156 155 std::list< Expression * > exps; 157 156 buildMoveList( ctl, exps ); 158 157 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 ); 174 159 } 175 160 … … 181 166 return new TryStmt( noLabels, tryBlock, branches, finallyBlock ); 182 167 } 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());168 Statement *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 ); 188 173 } 189 174 Statement *build_finally( StatementNode *stmt ) { 
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  