Ignore:
Timestamp:
Jun 27, 2018, 3:28:41 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
b21c77a
Parents:
0182bfa (diff), 63238a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into with_gc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.cc

    r0182bfa r28f3a19  
    640640
    641641
     642DefaultArgExpr::DefaultArgExpr( Expression * expr ) : expr( expr ) {
     643        assert( expr->result );
     644        result = expr->result->clone();
     645}
     646DefaultArgExpr::DefaultArgExpr( const DefaultArgExpr & other ) : Expression( other ), expr( maybeClone( other.expr ) ) {}
     647
     648void DefaultArgExpr::print( std::ostream & os, Indenter indent ) const {
     649        os << "Default Argument Expression" << std::endl << indent+1;
     650        expr->print( os, indent+1 );
     651}
     652
     653GenericExpr::Association::Association( Type * type, Expression * expr ) : type( type ), expr( expr ), isDefault( false ) {}
     654GenericExpr::Association::Association( Expression * expr ) : type( nullptr ), expr( expr ), isDefault( true ) {}
     655GenericExpr::Association::Association( const Association & other ) : type( maybeClone( other.type ) ), expr( maybeClone( other.expr ) ), isDefault( other.isDefault ) {}
     656
     657GenericExpr::GenericExpr( Expression * control, const std::list<Association> & assoc ) : Expression(), control( control ), associations( assoc ) {}
     658GenericExpr::GenericExpr( const GenericExpr & other ) : Expression(other), control( maybeClone( other.control ) ), associations( other.associations ) {}
     659GenericExpr::~GenericExpr() {}
     660
     661void GenericExpr::print( std::ostream & os, Indenter indent ) const {
     662        os << "C11 _Generic Expression" << std::endl << indent+1;
     663        control->print( os, indent+1 );
     664        os << std::endl << indent+1 << "... with associations: " << std::endl;
     665        for ( const Association & assoc : associations ) {
     666                os << indent+1;
     667                if (assoc.isDefault) {
     668                        os << "... default: ";
     669                        assoc.expr->print( os, indent+1 );
     670                } else {
     671                        os << "... type: ";
     672                        assoc.type->print( os, indent+1 );
     673                        os << std::endl << indent+1 << "... expression: ";
     674                        assoc.expr->print( os, indent+1 );
     675                        os << std::endl;
     676                }
     677                os << std::endl;
     678        }
     679}
     680
    642681// Local Variables: //
    643682// tab-width: 4 //
Note: See TracChangeset for help on using the changeset viewer.