Changeset 835d6e8 for src/AST


Ignore:
Timestamp:
Apr 5, 2023, 4:45:38 PM (15 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
c468150
Parents:
3e94a23
Message:

ast::SuspendStmt::Type -> ::Kind, this fits the new convention where Type is limited for actual compiler types.

Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r3e94a23 r835d6e8  
    559559                auto stmt = new SuspendStmt();
    560560                stmt->then   = get<CompoundStmt>().accept1( node->then   );
    561                 switch(node->type) {
     561                switch (node->kind) {
    562562                        case ast::SuspendStmt::None     : stmt->type = SuspendStmt::None     ; break;
    563563                        case ast::SuspendStmt::Coroutine: stmt->type = SuspendStmt::Coroutine; break;
     
    21312131        virtual void visit( const SuspendStmt * old ) override final {
    21322132                if ( inCache( old ) ) return;
    2133                 ast::SuspendStmt::Type type;
     2133                ast::SuspendStmt::Kind type;
    21342134                switch (old->type) {
    21352135                        case SuspendStmt::Coroutine: type = ast::SuspendStmt::Coroutine; break;
  • src/AST/Print.cpp

    r3e94a23 r835d6e8  
    739739        virtual const ast::Stmt * visit( const ast::SuspendStmt * node ) override final {
    740740                os << "Suspend Statement";
    741                 switch (node->type) {
    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;
     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;
    745745                }
    746746                os << endl;
  • src/AST/Stmt.hpp

    r3e94a23 r835d6e8  
    367367  public:
    368368        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) {}
    373373
    374374        const Stmt * accept( Visitor & v ) const override { return v.visit( this ); }
Note: See TracChangeset for help on using the changeset viewer.