Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/RunParser.cpp

    rcbd1ba8 r64b3cda  
    1010// Created On       : Mon Dec 19 11:00:00 2022
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Dec 19 11:15:00 2022
    13 // Update Count     : 0
     12// Last Modified On : Thr Dec 22 10:18:00 2022
     13// Update Count     : 1
    1414//
    1515
    1616#include "RunParser.hpp"
    1717
     18#include "AST/Convert.hpp"                  // for convert
     19#include "AST/TranslationUnit.hpp"          // for TranslationUnit
     20#include "CodeTools/TrackLoc.h"             // for fillLocations
     21#include "Common/CodeLocationTools.hpp"     // for forceFillCodeLocations
    1822#include "Parser/ParseNode.h"               // for DeclarationNode, buildList
    1923#include "Parser/TypedefTable.h"            // for TypedefTable
     
    4145} // parse
    4246
    43 void dumpParseTree( std::ostream & out ) {
    44         parseTree->printList( out );
    45         delete parseTree;
    46         parseTree = nullptr;
    47 }
    48 
    49 std::list<Declaration *> buildUnit(void) {
     47ast::TranslationUnit buildUnit(void) {
    5048        std::list<Declaration *> translationUnit;
    5149        buildList( parseTree, translationUnit );
     
    5452        parseTree = nullptr;
    5553
    56         return translationUnit;
     54        // When the parse/buildList code is translated to the new ast, these
     55        // fill passes (and the one after 'Hoist Type Decls') should be redundent
     56        // because the code locations should already be filled.
     57        CodeTools::fillLocations( translationUnit );
     58        ast::TranslationUnit transUnit = convert( std::move( translationUnit ) );
     59        forceFillCodeLocations( transUnit );
     60        return transUnit;
    5761}
    5862
Note: See TracChangeset for help on using the changeset viewer.