Changeset 835d6e8
- Timestamp:
- Apr 5, 2023, 4:45:38 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- c468150
- Parents:
- 3e94a23
- Location:
- src
- Files:
-
- 6 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 ); } -
src/Concurrency/KeywordsNew.cpp
r3e94a23 r835d6e8 779 779 780 780 const ast::Stmt * SuspendKeyword::postvisit( const ast::SuspendStmt * stmt ) { 781 switch ( stmt-> type) {781 switch ( stmt->kind ) { 782 782 case ast::SuspendStmt::None: 783 783 // Use the context to determain the implicit target. -
src/Parser/ParseNode.h
r3e94a23 r835d6e8 437 437 ast::Stmt * build_asm( const CodeLocation &, bool voltile, ast::Expr * instruction, ExpressionNode * output = nullptr, ExpressionNode * input = nullptr, ExpressionNode * clobber = nullptr, LabelNode * gotolabels = nullptr ); 438 438 ast::Stmt * build_directive( const CodeLocation &, std::string * directive ); 439 ast::SuspendStmt * build_suspend( const CodeLocation &, StatementNode *, ast::SuspendStmt:: Type);439 ast::SuspendStmt * build_suspend( const CodeLocation &, StatementNode *, ast::SuspendStmt::Kind ); 440 440 ast::WaitForStmt * build_waitfor( const CodeLocation &, ast::WaitForStmt * existing, ExpressionNode * when, ExpressionNode * targetExpr, StatementNode * stmt ); 441 441 ast::WaitForStmt * build_waitfor_else( const CodeLocation &, ast::WaitForStmt * existing, ExpressionNode * when, StatementNode * stmt ); -
src/Parser/StatementNode.cc
r3e94a23 r835d6e8 362 362 } // build_finally 363 363 364 ast::SuspendStmt * build_suspend( const CodeLocation & location, StatementNode * then, ast::SuspendStmt:: Type type) {364 ast::SuspendStmt * build_suspend( const CodeLocation & location, StatementNode * then, ast::SuspendStmt::Kind kind ) { 365 365 std::vector<ast::ptr<ast::Stmt>> stmts; 366 366 buildMoveList( then, stmts ); … … 370 370 then2 = stmts.front().strict_as<ast::CompoundStmt>(); 371 371 } 372 auto node = new ast::SuspendStmt( location, then2, ast::SuspendStmt::None ); 373 node->type = type; 374 return node; 372 return new ast::SuspendStmt( location, then2, kind ); 375 373 } // build_suspend 376 374
Note: See TracChangeset
for help on using the changeset viewer.