Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    rc468150 rbb7422a  
    1515//
    1616
    17 #include "StatementNode.h"
    18 
    1917#include <cassert>                 // for assert, strict_dynamic_cast, assertf
    2018#include <memory>                  // for unique_ptr
     
    2523#include "Common/SemanticError.h"  // for SemanticError
    2624#include "Common/utility.h"        // for maybeMoveBuild, maybeBuild
    27 #include "DeclarationNode.h"       // for DeclarationNode
    28 #include "ExpressionNode.h"        // for ExpressionNode
     25#include "ParseNode.h"             // for StatementNode, ExpressionNode, bui...
    2926#include "parserutility.h"         // for notZeroExpr
    3027
     
    5552        stmt.reset( new ast::DeclStmt( declLocation, maybeMoveBuild( agg ) ) );
    5653} // StatementNode::StatementNode
    57 
    58 StatementNode * StatementNode::add_label(
    59                 const CodeLocation & location,
    60                 const std::string * name,
    61                 DeclarationNode * attr ) {
    62         stmt->labels.emplace_back( location,
    63                 *name,
    64                 attr ? std::move( attr->attributes )
    65                         : std::vector<ast::ptr<ast::Attribute>>{} );
    66         delete attr;
    67         delete name;
    68         return this;
    69 }
    7054
    7155StatementNode * StatementNode::append_last_case( StatementNode * stmt ) {
     
    234218                astelse.empty() ? nullptr : astelse.front().release(),
    235219                std::move( astinit ),
    236                 ast::While
     220                false
    237221        );
    238222} // build_while
     
    253237                astelse.empty() ? nullptr : astelse.front().release(),
    254238                {},
    255                 ast::DoWhile
     239                true
    256240        );
    257241} // build_do_while
     
    378362} // build_finally
    379363
    380 ast::SuspendStmt * build_suspend( const CodeLocation & location, StatementNode * then, ast::SuspendStmt::Kind kind ) {
     364ast::SuspendStmt * build_suspend( const CodeLocation & location, StatementNode * then, ast::SuspendStmt::Type type ) {
    381365        std::vector<ast::ptr<ast::Stmt>> stmts;
    382366        buildMoveList( then, stmts );
     
    386370                then2 = stmts.front().strict_as<ast::CompoundStmt>();
    387371        }
    388         return new ast::SuspendStmt( location, then2, kind );
     372        auto node = new ast::SuspendStmt( location, then2, ast::SuspendStmt::None );
     373        node->type = type;
     374        return node;
    389375} // build_suspend
    390376
Note: See TracChangeset for help on using the changeset viewer.