Changes in src/Parser/StatementNode.cc [c468150:bb7422a]
- File:
-
- 1 edited
-
src/Parser/StatementNode.cc (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/StatementNode.cc
rc468150 rbb7422a 15 15 // 16 16 17 #include "StatementNode.h"18 19 17 #include <cassert> // for assert, strict_dynamic_cast, assertf 20 18 #include <memory> // for unique_ptr … … 25 23 #include "Common/SemanticError.h" // for SemanticError 26 24 #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... 29 26 #include "parserutility.h" // for notZeroExpr 30 27 … … 55 52 stmt.reset( new ast::DeclStmt( declLocation, maybeMoveBuild( agg ) ) ); 56 53 } // 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 }70 54 71 55 StatementNode * StatementNode::append_last_case( StatementNode * stmt ) { … … 234 218 astelse.empty() ? nullptr : astelse.front().release(), 235 219 std::move( astinit ), 236 ast::While220 false 237 221 ); 238 222 } // build_while … … 253 237 astelse.empty() ? nullptr : astelse.front().release(), 254 238 {}, 255 ast::DoWhile239 true 256 240 ); 257 241 } // build_do_while … … 378 362 } // build_finally 379 363 380 ast::SuspendStmt * build_suspend( const CodeLocation & location, StatementNode * then, ast::SuspendStmt:: Kind kind) {364 ast::SuspendStmt * build_suspend( const CodeLocation & location, StatementNode * then, ast::SuspendStmt::Type type ) { 381 365 std::vector<ast::ptr<ast::Stmt>> stmts; 382 366 buildMoveList( then, stmts ); … … 386 370 then2 = stmts.front().strict_as<ast::CompoundStmt>(); 387 371 } 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; 389 375 } // build_suspend 390 376
Note:
See TracChangeset
for help on using the changeset viewer.