Changeset 65660bd for src/SynTree


Ignore:
Timestamp:
Sep 22, 2016, 8:14:56 AM (9 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
ac9ca96
Parents:
1132b62
git-author:
Rob Schluntz <rschlunt@…> (09/21/16 23:43:37)
git-committer:
Rob Schluntz <rschlunt@…> (09/22/16 08:14:56)
Message:

replace multiple-returning functions with tuple-returning functions, implement tuple ctor/dtor, allow N-arg tuple assignment

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r1132b62 r65660bd  
    696696};
    697697
    698 /// TupleAssignExpr represents a multiple assignment operation, where both sides of the assignment have tuple type, e.g. [a, b, c] = [d, e, f];, or a mass assignment operation, where the left hand side has tuple type and the right hand side does not, e.g. [a, b, c] = 5.0;
     698/// TupleAssignExpr represents a multiple assignment operation, where both sides of the assignment have tuple type, e.g. [a, b, c] = [d, e, f];, a mass assignment operation, where the left hand side has tuple type and the right hand side does not, e.g. [a, b, c] = 5.0;, or a tuple ctor/dtor expression
    699699class TupleAssignExpr : public Expression {
    700700  public:
  • src/SynTree/TupleExpr.cc

    r1132b62 r65660bd  
    8888
    8989TupleAssignExpr::TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls, Expression * _aname ) : Expression( _aname ), assigns( assigns ), tempDecls( tempDecls ) {
    90         TupleType * type = new TupleType( Type::Qualifiers() );
    91         for ( Expression * expr : assigns ) {
    92                 assert( expr->has_result() );
    93                 type->get_types().push_back( expr->get_result()->clone() );
    94         }
    95         set_result( type );
     90        set_result( Tuples::makeTupleType( assigns ) );
    9691}
    9792
Note: See TracChangeset for help on using the changeset viewer.