Ignore:
Timestamp:
Apr 6, 2023, 10:13:38 AM (15 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
39b2403, fac05b3
Parents:
835d6e8
Message:

Split up ParseNode?.h so that headers match implementation. May have a bit less to include total because of it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/StatementNode.cc

    r835d6e8 rc468150  
    1515//
    1616
     17#include "StatementNode.h"
     18
    1719#include <cassert>                 // for assert, strict_dynamic_cast, assertf
    1820#include <memory>                  // for unique_ptr
     
    2325#include "Common/SemanticError.h"  // for SemanticError
    2426#include "Common/utility.h"        // for maybeMoveBuild, maybeBuild
    25 #include "ParseNode.h"             // for StatementNode, ExpressionNode, bui...
     27#include "DeclarationNode.h"       // for DeclarationNode
     28#include "ExpressionNode.h"        // for ExpressionNode
    2629#include "parserutility.h"         // for notZeroExpr
    2730
     
    5255        stmt.reset( new ast::DeclStmt( declLocation, maybeMoveBuild( agg ) ) );
    5356} // StatementNode::StatementNode
     57
     58StatementNode * 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}
    5470
    5571StatementNode * StatementNode::append_last_case( StatementNode * stmt ) {
Note: See TracChangeset for help on using the changeset viewer.