Ignore:
Timestamp:
Aug 16, 2016, 9:49:29 PM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
5ead9f9
Parents:
08ac489
Message:

more refactoring of parser code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.cc

    r08ac489 rcbaee0d  
    1010// Created On       : Sat May 16 13:26:29 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Aug 16 11:41:39 2016
    13 // Update Count     : 114
     12// Last Modified On : Tue Aug 16 21:31:47 2016
     13// Update Count     : 125
    1414//
    1515
     
    2828
    2929ParseNode *ParseNode::get_last() {
    30         ParseNode *current = this;
    31 
    32         while ( current->get_next() != 0 )
    33         current = current->get_next();
     30        ParseNode *current;
     31        for ( current = this; current->get_next() != 0; current = current->get_next() );
    3432        return current;
    3533}
    3634
    37 ParseNode *ParseNode::set_last( ParseNode *next_ ) {
    38         if ( next_ != 0 ) get_last()->next = next_;
     35ParseNode *ParseNode::set_last( ParseNode *newlast ) {
     36        if ( newlast != 0 ) get_last()->set_next( newlast );
    3937        return this;
    4038}
Note: See TracChangeset for help on using the changeset viewer.