Changes in src/AST/Stmt.hpp [94c98f0e:491bb81]
- File:
-
- 1 edited
-
src/AST/Stmt.hpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Stmt.hpp
r94c98f0e r491bb81 10 10 // Created On : Wed May 8 13:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Apr 5 10:34:00 202313 // Update Count : 3 712 // Last Modified On : Wed Apr 20 14:34:00 2022 13 // Update Count : 36 14 14 // 15 15 … … 205 205 }; 206 206 207 // A while loop or a do-while loop:208 enum WhileDoKind { While, DoWhile };209 210 207 // While loop: while (...) ... else ... or do ... while (...) else ...; 211 208 class WhileDoStmt final : public Stmt { … … 215 212 ptr<Stmt> else_; 216 213 std::vector<ptr<Stmt>> inits; 217 WhileDoKindisDoWhile;214 bool isDoWhile; 218 215 219 216 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 = {} ) 221 218 : Stmt(loc, std::move(labels)), cond(cond), body(body), else_(nullptr), inits(std::move(inits)), isDoWhile(isDoWhile) {} 222 219 223 220 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 = {} ) 225 222 : Stmt(loc, std::move(labels)), cond(cond), body(body), else_(else_), inits(std::move(inits)), isDoWhile(isDoWhile) {} 226 223 … … 367 364 public: 368 365 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) {} 373 370 374 371 const Stmt * accept( Visitor & v ) const override { return v.visit( this ); } … … 397 394 }; 398 395 399 // Clause in a waitfor statement: waitfor (..., ...) ...400 396 class WaitForClause final : public StmtClause { 401 397 public: … … 458 454 MUTATE_FRIEND 459 455 }; 460 461 456 } // namespace ast 462 457
Note:
See TracChangeset
for help on using the changeset viewer.