Changeset 3d9d017 for src/AST/Stmt.hpp


Ignore:
Timestamp:
Nov 6, 2023, 2:19:37 PM (9 months ago)
Author:
caparson <caparson@…>
Branches:
master
Children:
ba0e1bc
Parents:
49ae2bc
Message:

added cofor implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Stmt.hpp

    r49ae2bc r3d9d017  
    546546};
    547547
     548// Corun Statement
     549class CoforStmt final : public Stmt {
     550  public:
     551        std::vector<ptr<Stmt>> inits;
     552        ptr<Expr> cond;
     553        ptr<Expr> inc;
     554        ptr<Stmt> body;
     555
     556        CoforStmt( const CodeLocation & loc, const std::vector<ptr<Stmt>> && inits, const Expr * cond,
     557                         const Expr * inc, const Stmt * body, const std::vector<Label> && label = {} )
     558                : Stmt(loc, std::move(label)), inits(std::move(inits)), cond(cond), inc(inc), body(body) {}
     559
     560        const Stmt * accept( Visitor & v ) const override { return v.visit( this ); }
     561  private:
     562        CoforStmt * clone() const override { return new CoforStmt{ *this }; }
     563        MUTATE_FRIEND
     564};
     565
    548566} // namespace ast
    549567
Note: See TracChangeset for help on using the changeset viewer.