Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main.cc

    r046a890 ra77257be  
    3131using namespace std;
    3232
    33 
     33#include "AST/Convert.hpp"
    3434#include "CompilationState.h"
    3535#include "../config.h"                      // for CFA_LIBDIR
     
    340340                } // if
    341341
    342                 PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
     342                if( useNewAST) {
     343                        auto transUnit = convert( move( translationUnit ) );
     344                        PASS( "Resolve", ResolvExpr::resolve( transUnit ) );
     345                        translationUnit = convert( move( transUnit ) );
     346                } else {
     347                        PASS( "Resolve", ResolvExpr::resolve( translationUnit ) );
     348                }
     349
    343350                if ( exprp ) {
    344351                        dump( translationUnit );
     
    458465        { "prototypes", no_argument, nullptr, 'p' },
    459466        { "deterministic-out", no_argument, nullptr, 'd' },
     467        { "old-ast", no_argument, nullptr, 'O'},
     468        { "new-ast", no_argument, nullptr, 'A'},
    460469        { "print", required_argument, nullptr, 'P' },
    461470        { "prelude-dir", required_argument, nullptr, PreludeDir },
     
    479488        "generate prototypes for prelude functions",            // -p
    480489        "don't print output that isn't deterministic",        // -d
     490        "Use the old-ast",                                    // -O
     491        "Use the new-ast",                                    // -A
    481492        "print",                                              // -P
    482493        "<directory> prelude directory for debug/nodebug",      // no flag
     
    584595                        break;
    585596                  case 'd':                                     // don't print non-deterministic output
    586                     deterministic_output = true;
     597                        deterministic_output = true;
     598                        break;
     599                  case 'O':                                     // don't print non-deterministic output
     600                        useNewAST = false;
     601                        break;
     602                  case 'A':                                     // don't print non-deterministic output
     603                        useNewAST = true;
    587604                        break;
    588605                  case 'P':                                                                             // print options
Note: See TracChangeset for help on using the changeset viewer.