Changeset 145f1fc for src/Parser


Ignore:
Timestamp:
Jul 15, 2015, 2:59:57 PM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
Children:
1ab4ce2, 2794fff, e45215c
Parents:
85c4ef0
Message:

modified ForStmt? to have a list of statements for the initialization portion, and reverted to hoisting the initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    r85c4ef0 r145f1fc  
    99// Author           : Rodolfo G. Esteves
    1010// Created On       : Sat May 16 14:59:41 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jun  6 23:25:41 2015
    13 // Update Count     : 19
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Tue Jul 14 12:20:44 2015
     13// Update Count     : 21
    1414//
    1515
     
    271271                        assert( ctl != 0 );
    272272
    273                         Statement *stmt = 0;
    274                         if ( ctl->get_init() != 0 )
    275                                 stmt = ctl->get_init()->build();
     273                        std::list<Statement *> init;
     274                        if ( ctl->get_init() != 0 ) {
     275                                buildList( ctl->get_init(), init );
     276                        }
    276277
    277278                        Expression *cond = 0;
     
    283284                                incr = ctl->get_change()->build();
    284285
    285                         return new ForStmt( labs, stmt, cond, incr, branches.front() );
     286                        return new ForStmt( labs, init, cond, incr, branches.front() );
    286287                }
    287288          case Switch:
Note: See TracChangeset for help on using the changeset viewer.