Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Stmt.hpp

    re67991f r99da267  
    2727
    2828// Must be included in *all* AST classes; should be #undef'd at the end of the file
    29 #define MUTATE_FRIEND template<typename node_t> friend node_t * mutate(const node_t * node);
     29#define MUTATE_FRIEND \
     30    template<typename node_t> friend node_t * mutate(const node_t * node); \
     31        template<typename node_t> friend node_t * shallowCopy(const node_t * node);
    3032
    3133namespace ast {
     
    380382};
    381383
     384/// With statement `with (...) ...`
     385class WithStmt final : public Stmt {
     386public:
     387        std::vector<ptr<Expr>> exprs;
     388        ptr<Stmt> stmt;
     389
     390        WithStmt( const CodeLocation & loc, std::vector<ptr<Expr>> && exprs, const Stmt * stmt,
     391                std::vector<Label> && labels = {} )
     392        : Stmt(loc, std::move(labels)), exprs(std::move(exprs)), stmt(stmt) {}
     393
     394        const Stmt * accept( Visitor & v ) const override { return v.visit( this ); }
     395private:
     396        WithStmt * clone() const override { return new WithStmt{ *this }; }
     397        MUTATE_FRIEND
     398};
     399
    382400/// Any declaration in a (compound) statement.
    383401class DeclStmt final : public Stmt {
Note: See TracChangeset for help on using the changeset viewer.