- Timestamp:
- Apr 5, 2023, 4:45:38 PM (15 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- c468150
- Parents:
- 3e94a23
- Location:
- src/AST
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r3e94a23 r835d6e8 559 559 auto stmt = new SuspendStmt(); 560 560 stmt->then = get<CompoundStmt>().accept1( node->then ); 561 switch (node->type) {561 switch (node->kind) { 562 562 case ast::SuspendStmt::None : stmt->type = SuspendStmt::None ; break; 563 563 case ast::SuspendStmt::Coroutine: stmt->type = SuspendStmt::Coroutine; break; … … 2131 2131 virtual void visit( const SuspendStmt * old ) override final { 2132 2132 if ( inCache( old ) ) return; 2133 ast::SuspendStmt:: Typetype;2133 ast::SuspendStmt::Kind type; 2134 2134 switch (old->type) { 2135 2135 case SuspendStmt::Coroutine: type = ast::SuspendStmt::Coroutine; break; -
src/AST/Print.cpp
r3e94a23 r835d6e8 739 739 virtual const ast::Stmt * visit( const ast::SuspendStmt * node ) override final { 740 740 os << "Suspend Statement"; 741 switch (node-> type) {742 743 744 741 switch (node->kind) { 742 case ast::SuspendStmt::None : os << " with implicit target"; break; 743 case ast::SuspendStmt::Generator: os << " for generator"; break; 744 case ast::SuspendStmt::Coroutine: os << " for coroutine"; break; 745 745 } 746 746 os << endl; -
src/AST/Stmt.hpp
r3e94a23 r835d6e8 367 367 public: 368 368 ptr<CompoundStmt> then; 369 enum Type { None, Coroutine, Generator } type= None;370 371 SuspendStmt( const CodeLocation & loc, const CompoundStmt * then, Type type, const std::vector<Label> && labels = {} )372 : Stmt(loc, std::move(labels)), then(then), type(type) {}369 enum Kind { None, Coroutine, Generator } kind = None; 370 371 SuspendStmt( const CodeLocation & loc, const CompoundStmt * then, Kind kind, const std::vector<Label> && labels = {} ) 372 : Stmt(loc, std::move(labels)), then(then), kind(kind) {} 373 373 374 374 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); }
Note: See TracChangeset
for help on using the changeset viewer.