Changeset 8d7bef2 for src/Parser/ParseNode.h
- Timestamp:
- Mar 20, 2018, 5:12:25 PM (6 years ago)
- Branches:
- new-env, with_gc
- Children:
- 7e4b44db
- Parents:
- 68f9c43
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/ParseNode.h
r68f9c43 r8d7bef2 124 124 125 125 virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override { 126 os << expr .get()<< std::endl;126 os << expr << std::endl; 127 127 } 128 128 void printOneLine( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const {} 129 129 130 130 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; } 134 134 private: 135 135 bool extension = false; 136 std::unique_ptr<Expression>expr;136 Expression* expr; 137 137 }; // ExpressionNode 138 138 … … 352 352 353 353 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; } 355 355 356 356 virtual StatementNode * add_label( const std::string * name, DeclarationNode * attr = nullptr ) { … … 364 364 365 365 virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override { 366 os << stmt .get()<< std::endl;366 os << stmt << std::endl; 367 367 } 368 368 private: 369 std::unique_ptr<Statement>stmt;369 Statement* stmt; 370 370 }; // StatementNode 371 371
Note: See TracChangeset
for help on using the changeset viewer.