Changeset 546e712 for src/SynTree


Ignore:
Timestamp:
Jun 6, 2019, 3:01:46 PM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8c0d801, f46bfd2f
Parents:
2a54479
Message:

Fix for 1 bug of N

Location:
src/SynTree
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/DeclReplacer.h

    r2a54479 r546e712  
    3333
    3434        size_t replace( BaseSyntaxNode *& node, const ExprMap & exprMap, bool debug = false);
     35
    3536        template<typename T>
    36                 void replace( T *& node, const ExprMap & exprMap, bool debug = false ) {
    37                 if ( ! node ) return;
     37        size_t replace( T *& node, const ExprMap & exprMap, bool debug = false ) {
     38                if ( ! node ) return 0ul;
    3839                BaseSyntaxNode * arg = node;
    39                 replace( arg, exprMap, debug );
     40                size_t replaced = replace( arg, exprMap, debug );
    4041                node = dynamic_cast<T *>( arg );
    4142                assertf( node, "DeclReplacer fundamentally changed the type of its argument." );
     43                return replaced;
    4244        }
    4345}
  • src/SynTree/Expression.cc

    r2a54479 r546e712  
    102102        SemanticError( this, "Constant expression of non-integral type " );
    103103}
     104
     105VariableExpr::VariableExpr() : Expression(), var( nullptr ) {}
    104106
    105107VariableExpr::VariableExpr( DeclarationWithType *_var ) : Expression(), var( _var ) {
  • src/SynTree/Expression.h

    r2a54479 r546e712  
    299299        DeclarationWithType * var;
    300300
     301        VariableExpr();
    301302        VariableExpr( DeclarationWithType * var );
    302303        VariableExpr( const VariableExpr & other );
Note: See TracChangeset for help on using the changeset viewer.