Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Stmt.hpp

    r94c98f0e r491bb81  
    1010// Created On       : Wed May  8 13:00:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Wed Apr  5 10:34:00 2023
    13 // Update Count     : 37
     12// Last Modified On : Wed Apr 20 14:34:00 2022
     13// Update Count     : 36
    1414//
    1515
     
    205205};
    206206
    207 // A while loop or a do-while loop:
    208 enum WhileDoKind { While, DoWhile };
    209 
    210207// While loop: while (...) ... else ... or do ... while (...) else ...;
    211208class WhileDoStmt final : public Stmt {
     
    215212        ptr<Stmt> else_;
    216213        std::vector<ptr<Stmt>> inits;
    217         WhileDoKind isDoWhile;
     214        bool isDoWhile;
    218215
    219216        WhileDoStmt( const CodeLocation & loc, const Expr * cond, const Stmt * body,
    220                                  const std::vector<ptr<Stmt>> && inits, WhileDoKind isDoWhile = While, const std::vector<Label> && labels = {} )
     217                                 const std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, const std::vector<Label> && labels = {} )
    221218                : Stmt(loc, std::move(labels)), cond(cond), body(body), else_(nullptr), inits(std::move(inits)), isDoWhile(isDoWhile) {}
    222219
    223220        WhileDoStmt( const CodeLocation & loc, const Expr * cond, const Stmt * body, const Stmt * else_,
    224                                  const std::vector<ptr<Stmt>> && inits, WhileDoKind isDoWhile = While, const std::vector<Label> && labels = {} )
     221                                 const std::vector<ptr<Stmt>> && inits, bool isDoWhile = false, const std::vector<Label> && labels = {} )
    225222                : Stmt(loc, std::move(labels)), cond(cond), body(body), else_(else_), inits(std::move(inits)), isDoWhile(isDoWhile) {}
    226223
     
    367364  public:
    368365        ptr<CompoundStmt> then;
    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) {}
     366        enum Type { None, Coroutine, Generator } type = None;
     367
     368        SuspendStmt( const CodeLocation & loc, const CompoundStmt * then, Type type, const std::vector<Label> && labels = {} )
     369                : Stmt(loc, std::move(labels)), then(then), type(type) {}
    373370
    374371        const Stmt * accept( Visitor & v ) const override { return v.visit( this ); }
     
    397394};
    398395
    399 // Clause in a waitfor statement: waitfor (..., ...) ...
    400396class WaitForClause final : public StmtClause {
    401397  public:
     
    458454        MUTATE_FRIEND
    459455};
    460 
    461456} // namespace ast
    462457
Note: See TracChangeset for help on using the changeset viewer.