Changeset 6e1e2d0 for src/Common


Ignore:
Timestamp:
May 1, 2023, 4:19:09 PM (13 months ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
c083c3d
Parents:
a50fdfb (diff), 985b624 (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:

resolved merge conflicts

Location:
src/Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Common/CodeLocationTools.cpp

    ra50fdfb r6e1e2d0  
    210210
    211211struct LeafKindVisitor : public ast::Visitor {
    212         LeafKind kind;
     212        LeafKind result;
    213213
    214214#define VISIT(node_type, return_type) \
    215215        const ast::return_type * visit( const ast::node_type * ) final { \
    216                 kind = LeafKind::node_type; \
     216                result = LeafKind::node_type; \
    217217                return nullptr; \
    218218        }
     
    224224
    225225LeafKind get_leaf_kind( ast::Node const * node ) {
    226         LeafKindVisitor visitor;
    227         node->accept( visitor );
    228         return visitor.kind;
     226        return ast::Pass<LeafKindVisitor>::read( node );
    229227}
    230228
  • src/Common/Iterate.hpp

    ra50fdfb r6e1e2d0  
    2020#include <iterator>
    2121
    22 // it's nice to actually be able to increment iterators by an arbitrary amount
     22// Returns an iterator that is it advanced n times.
    2323template< class InputIt, class Distance >
    2424InputIt operator+( InputIt it, Distance n ) {
     
    5050
    5151// -----------------------------------------------------------------------------
     52// Helper struct and function to support
     53// for ( val_and_index : enumerate( container ) ) {}
     54// which iterates through the container and tracks the index as well.
     55
    5256template< typename T >
    5357struct enumerate_t {
     
    109113
    110114// -----------------------------------------------------------------------------
     115// Helper function to transform one iterable container into another.
     116
    111117template< typename OutType, typename Range, typename Functor >
    112118OutType map_range( const Range& range, Functor&& functor ) {
     
    206212// Helper struct and function to support
    207213// for ( val : lazy_map( container1, f ) ) {}
    208 // syntax to have a for each that iterates a container, mapping each element by applying f
     214// syntax to have a for each that iterates a container,
     215// mapping each element by applying f.
     216
    209217template< typename T, typename Func >
    210218struct lambda_iterate_t {
Note: See TracChangeset for help on using the changeset viewer.