Ignore:
File:
1 edited

Legend:

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

    re61207e7 rc671112  
    1919#include <type_traits>
    2020#include <unordered_map>
     21
     22#include "AST/TypeSubstitution.hpp"
    2123
    2224#define VISIT_START( node ) \
     
    462464        VISIT({
    463465                guard_indexer guard { * this };
    464                 maybe_accept( node, &StructDecl::params  );
    465                 maybe_accept( node, &StructDecl::members );
     466                maybe_accept( node, &StructDecl::params );
     467                maybe_accept( node, &StructDecl::members    );
    466468        })
    467469
     
    483485        VISIT({
    484486                guard_indexer guard { * this };
    485                 maybe_accept( node, &UnionDecl::params  );
    486                 maybe_accept( node, &UnionDecl::members );
     487                maybe_accept( node, &UnionDecl::params );
     488                maybe_accept( node, &UnionDecl::members    );
    487489        })
    488490
     
    502504        VISIT(
    503505                // unlike structs, traits, and unions, enums inject their members into the global scope
    504                 maybe_accept( node, &EnumDecl::params  );
    505                 maybe_accept( node, &EnumDecl::members );
     506                maybe_accept( node, &EnumDecl::params );
     507                maybe_accept( node, &EnumDecl::members    );
    506508        )
    507509
     
    517519        VISIT({
    518520                guard_indexer guard { *this };
    519                 maybe_accept( node, &TraitDecl::params  );
    520                 maybe_accept( node, &TraitDecl::members );
     521                maybe_accept( node, &TraitDecl::params );
     522                maybe_accept( node, &TraitDecl::members    );
    521523        })
    522524
     
    535537                guard_indexer guard { *this };
    536538                maybe_accept( node, &TypeDecl::params );
    537                 maybe_accept( node, &TypeDecl::base   );
     539                maybe_accept( node, &TypeDecl::base       );
    538540        })
    539541
     
    564566                guard_indexer guard { *this };
    565567                maybe_accept( node, &TypedefDecl::params );
    566                 maybe_accept( node, &TypedefDecl::base   );
     568                maybe_accept( node, &TypedefDecl::base       );
    567569        })
    568570
     
    688690                maybe_accept( node, &WhileStmt::body  );
    689691        })
    690 
    691         VISIT_END( Stmt, node );
    692 }
    693 
    694 //--------------------------------------------------------------------------
    695 // ForStmt
    696 template< typename pass_t >
    697 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ForStmt * node ) {
    698         VISIT_START( node );
    699 
    700         VISIT({
    701                 // for statements introduce a level of scope (for the initialization)
    702                 guard_indexer guard { *this };
    703                 maybe_accept( node, &ForStmt::inits );
    704                 maybe_accept( node, &ForStmt::cond  );
    705                 maybe_accept( node, &ForStmt::inc   );
    706                 maybe_accept( node, &ForStmt::body  );
    707         })
    708 
    709         VISIT_END( Stmt, node );
    710 }
    711 
    712 //--------------------------------------------------------------------------
    713 // SwitchStmt
    714 template< typename pass_t >
    715 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::SwitchStmt * node ) {
    716         VISIT_START( node );
    717 
    718         VISIT(
    719                 maybe_accept( node, &SwitchStmt::cond  );
    720                 maybe_accept( node, &SwitchStmt::stmts );
    721         )
    722 
    723         VISIT_END( Stmt, node );
    724 }
    725 
    726 //--------------------------------------------------------------------------
    727 // CaseStmt
    728 template< typename pass_t >
    729 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::CaseStmt * node ) {
    730         VISIT_START( node );
    731 
    732         VISIT(
    733                 maybe_accept( node, &CaseStmt::cond  );
    734                 maybe_accept( node, &CaseStmt::stmts );
    735         )
    736 
    737         VISIT_END( Stmt, node );
    738 }
    739 
    740 //--------------------------------------------------------------------------
    741 // BranchStmt
    742 template< typename pass_t >
    743 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::BranchStmt * node ) {
    744         VISIT_START( node );
    745         VISIT_END( Stmt, node );
    746 }
    747 
    748 //--------------------------------------------------------------------------
    749 // ReturnStmt
    750 template< typename pass_t >
    751 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ReturnStmt * node ) {
    752         VISIT_START( node );
    753 
    754         VISIT(
    755                 maybe_accept( node, &ReturnStmt::expr );
    756         )
    757 
    758         VISIT_END( Stmt, node );
    759 }
    760 
    761 //--------------------------------------------------------------------------
    762 // ThrowStmt
    763 template< typename pass_t >
    764 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::ThrowStmt * node ) {
    765         VISIT_START( node );
    766 
    767         VISIT(
    768                 maybe_accept( node, &ThrowStmt::expr   );
    769                 maybe_accept( node, &ThrowStmt::target );
    770         )
    771 
    772         VISIT_END( Stmt, node );
    773 }
    774 
    775 //--------------------------------------------------------------------------
    776 // TryStmt
    777 template< typename pass_t >
    778 const ast::Stmt * ast::Pass< pass_t >::visit( const ast::TryStmt * node ) {
    779         VISIT_START( node );
    780 
    781         VISIT(
    782                 maybe_accept( node, &TryStmt::block        );
    783                 maybe_accept( node, &TryStmt::handlers     );
    784                 maybe_accept( node, &TryStmt::finallyBlock );
    785         )
    786692
    787693        VISIT_END( Stmt, node );
Note: See TracChangeset for help on using the changeset viewer.