Ignore:
Timestamp:
Jun 19, 2024, 3:20:39 PM (2 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
57e43cd
Parents:
1725989
Message:
  1. Add count_e( enum_name ), a pseudo function that return the number of element in an enum; 2. Implementation of enum range loop.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.impl.hpp

    r1725989 r525f7ad  
    802802                maybe_accept_top( node, &ForStmt::cond  );
    803803                maybe_accept_top( node, &ForStmt::inc   );
     804                maybe_accept_top( node, &ForStmt::range_over );
    804805                maybe_accept_as_compound( node, &ForStmt::body  );
    805806        }
     
    13231324        }
    13241325
     1326        VISIT_END( Expr, node );
     1327}
     1328
     1329//--------------------------------------------------------------------------
     1330// CountExpr
     1331template< typename core_t >
     1332const ast::Expr * ast::Pass< core_t >::visit( const ast::CountExpr * node ) {
     1333        VISIT_START( node );
     1334        if ( __visit_children() ) {
     1335                {
     1336                        guard_symtab guard { *this };
     1337                        maybe_accept( node, &CountExpr::result );
     1338                }
     1339                maybe_accept( node, &CountExpr::type );
     1340        }
    13251341        VISIT_END( Expr, node );
    13261342}
Note: See TracChangeset for help on using the changeset viewer.