Changeset e0e9a0b for src/AST/Node.hpp


Ignore:
Timestamp:
Jun 27, 2019, 5:16:54 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7d0881c
Parents:
6be3b7d6
Message:

Somewhat deeper clone for types with forall qualifiers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Node.hpp

    r6be3b7d6 re0e9a0b  
    125125}
    126126
     127/// Mutate an entire indexed collection by cloning to accepted value
     128template<typename node_t, typename parent_t, typename coll_t>
     129const node_t * mutate_each( const node_t * node, coll_t parent_t::* field, Visitor & v ) {
     130        for ( unsigned i = 0; i < (node->*field).size(); ++i ) {
     131                node = mutate_field_index( node, field, i, (node->*field)[i]->accept( v ) );
     132        }
     133        return node;
     134}
     135
    127136std::ostream& operator<< ( std::ostream& out, const Node * node );
    128137
Note: See TracChangeset for help on using the changeset viewer.