Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/PassVisitor.impl.h

    rd55d7a6 r0ac366b  
    7777                        maybeAccept_impl( *i, visitor );
    7878                } catch( SemanticError &e ) {
     79                        e.set_location( (*i)->location );
    7980                        errors.append( e );
    8081                }
     
    103104                        maybeMutate_impl( *i, mutator );
    104105                } catch( SemanticError &e ) {
     106                        e.set_location( (*i)->location );
    105107                        errors.append( e );
    106108                }
     
    132134                        }
    133135                } catch( SemanticError &e ) {
     136                        e.set_location( (*i)->location );
    134137                        errors.append( e );
    135138                }
     
    160163                        } // if
    161164                } catch( SemanticError &e ) {
     165                        e.set_location( (*i)->location );
    162166                        errors.append( e );
    163167                } // try
     
    196200
    197201                } catch ( SemanticError &e ) {
     202                        e.set_location( (*i)->location );
    198203                        errors.append( e );
    199204                }
     
    393398                // shadow with exprs and not the other way around.
    394399                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    395                 indexerAddWith( node->withExprs );
     400                indexerAddWith( node->withExprs, node );
    396401                {
    397402                        auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     
    423428                // shadow with exprs and not the other way around.
    424429                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    425                 indexerAddWith( node->withExprs );
     430                indexerAddWith( node->withExprs, node );
    426431                {
    427432                        auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     
    10641069                // catch statements introduce a level of scope (for the caught exception)
    10651070                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    1066                 indexerAddWith( node->exprs );
     1071                indexerAddWith( node->exprs, node );
    10671072                maybeAccept_impl( node->stmt, *this );
    10681073        }
     
    10771082                // catch statements introduce a level of scope (for the caught exception)
    10781083                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
    1079                 indexerAddWith( node->exprs );
     1084                indexerAddWith( node->exprs, node );
    10801085                maybeMutate_impl( node->stmt, *this );
    10811086        }
     
    19711976}
    19721977
     1978//--------------------------------------------------------------------------
     1979// DeletedExpr
     1980template< typename pass_type >
     1981void PassVisitor< pass_type >::visit( DeletedExpr * node ) {
     1982        VISIT_START( node );
     1983
     1984        indexerScopedAccept( node->result, *this );
     1985        maybeAccept_impl( node->expr, *this );
     1986        // don't visit deleteStmt, because it is a pointer to somewhere else in the tree.
     1987
     1988        VISIT_END( node );
     1989}
     1990
     1991template< typename pass_type >
     1992Expression * PassVisitor< pass_type >::mutate( DeletedExpr * node ) {
     1993        MUTATE_START( node );
     1994
     1995        indexerScopedMutate( node->env, *this );
     1996        indexerScopedMutate( node->result, *this );
     1997        maybeMutate_impl( node->expr, *this );
     1998
     1999        MUTATE_END( Expression, node );
     2000}
     2001
     2002
    19732003template< typename pass_type >
    19742004void PassVisitor< pass_type >::visit( VoidType * node ) {
Note: See TracChangeset for help on using the changeset viewer.