Changeset 88bc876 for src/AST


Ignore:
Timestamp:
Jul 16, 2024, 5:28:10 PM (2 days ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
97f9619
Parents:
2363147
Message:

Breaks (and some other control flow) in a loop else clause now work. I also implemented else clauses in printing and code generation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Print.cpp

    r2363147 r88bc876  
    566566                ++indent;
    567567                safe_print( node->cond );
    568                 os << indent-1 << "... with body:" << endl;
    569                 safe_print( node->body );
    570568
    571569                if ( ! node->inits.empty() ) {
     
    573571                        printAll( node->inits );
    574572                }
     573
     574                os << indent-1 << "... with body:" << endl;
     575                safe_print( node->body );
     576
     577                if ( node->else_ ) {
     578                        os << indent-1 << "... with else:" << endl;
     579                        os << indent;
     580                        node->else_->accept( *this );
     581                }
     582
    575583                --indent;
    576584
     
    614622                        --indent;
    615623                }
     624
     625                if ( node->else_ ) {
     626                        os << indent << "... with else:" << endl;
     627                        ++indent;
     628                        os << indent;
     629                        node->else_->accept( *this );
     630                        --indent;
     631                }
     632
    616633                os << endl;
    617634                print( node->labels );
Note: See TracChangeset for help on using the changeset viewer.