Ignore:
Timestamp:
Mar 20, 2018, 5:12:25 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
7e4b44db
Parents:
68f9c43
Message:

First compiling build of CFA-CC with GC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    r68f9c43 r8d7bef2  
    124124
    125125        virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override {
    126                 os << expr.get() << std::endl;
     126                os << expr << std::endl;
    127127        }
    128128        void printOneLine( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const {}
    129129
    130130        template<typename T>
    131         bool isExpressionType() const { return nullptr != dynamic_cast<T>(expr.get()); }
    132 
    133         Expression * build() const { return const_cast<ExpressionNode *>(this)->expr.release(); }
     131        bool isExpressionType() const { return nullptr != dynamic_cast<T>(expr); }
     132
     133        Expression * build() const { return expr; }
    134134  private:
    135135        bool extension = false;
    136         std::unique_ptr<Expression> expr;
     136        Expression* expr;
    137137}; // ExpressionNode
    138138
     
    352352
    353353        virtual StatementNode * clone() const final { assert( false ); return nullptr; }
    354         Statement * build() const { return const_cast<StatementNode *>(this)->stmt.release(); }
     354        Statement * build() const { return stmt; }
    355355
    356356        virtual StatementNode * add_label( const std::string * name, DeclarationNode * attr = nullptr ) {
     
    364364
    365365        virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override {
    366                 os << stmt.get() << std::endl;
     366                os << stmt << std::endl;
    367367        }
    368368  private:
    369         std::unique_ptr<Statement> stmt;
     369        Statement* stmt;
    370370}; // StatementNode
    371371
Note: See TracChangeset for help on using the changeset viewer.