Changeset 94b1f718


Ignore:
Timestamp:
May 23, 2019, 6:24:16 PM (5 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
21a44ca
Parents:
a16e246
Message:

Add some Stmt printers

Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Label.hpp

    ra16e246 r94b1f718  
    3939
    4040        operator std::string () const { return name; }
    41         bool empty() { return name.empty(); }
     41        bool empty() const { return name.empty(); }
    4242};
    4343
  • src/AST/Print.cpp

    ra16e246 r94b1f718  
    118118        }
    119119
     120        void print( const std::vector<ast::Label> & labels ) {
     121                if ( labels.empty() ) return;
     122                os << indent << "... Labels: {";
     123                bool isFirst = true;
     124                for ( const Label & l : labels ) {
     125                        if ( isFirst ) { isFirst = false; } else { os << ","; }
     126                        os << l;
     127                }
     128                os << "}" << endl;
     129        }
     130
    120131        void print( const ast::Expr::InferUnion & inferred, unsigned level = 0 ) {
    121132                switch ( inferred.mode ) {
    122133                case ast::Expr::InferUnion::Empty: return;
    123134                case ast::Expr::InferUnion::Slots: {
    124                         os << indent << "with " << inferred.data.resnSlots.size() << " pending inference slots"
    125                            << std::endl;
     135                        os << indent << "with " << inferred.data.resnSlots.size()
     136                           << " pending inference slots" << endl;
    126137                        return;
    127138                }
    128139                case ast::Expr::InferUnion::Params: {
    129                         os << indent << "with inferred parameters " << level << ":" << std::endl;
     140                        os << indent << "with inferred parameters " << level << ":" << endl;
    130141                        ++indent;
    131142                        for ( const auto & i : inferred.data.inferParams ) {
    132143                                os << indent;
    133144                                short_print( Decl::fromId( i.second.decl ) );
    134                                 os << std::endl;
     145                                os << endl;
    135146                                print( i.second.expr->inferred, level+1 );
    136147                        }
     
    143154        void print( const ast::ParameterizedType::ForallList & forall ) {
    144155                if ( forall.empty() ) return;   
    145                 os << "forall" << std::endl;
     156                os << "forall" << endl;
    146157                ++indent;
    147158                printAll( forall );
     
    152163        void print( const std::vector<ptr<Attribute>> & attrs ) {
    153164                if ( attrs.empty() ) return;
    154                 os << "with attributes" << std::endl;
     165                os << "with attributes" << endl;
    155166                ++indent;
    156167                printAll( attrs );
     
    160171        void print( const std::vector<ptr<Expr>> & params ) {
    161172                if ( params.empty() ) return;
    162                 os << std::endl << indent << "... with parameters" << std::endl;
     173                os << endl << indent << "... with parameters" << endl;
    163174                ++indent;
    164175                printAll( params );
     
    226237
    227238                if ( node->env ) {
    228                         os << std::endl << indent << "... with environment:" << std::endl;
     239                        os << endl << indent << "... with environment:" << endl;
    229240                        ++indent;
    230241                        node->env->accept( *this );
     
    233244
    234245                if ( node->extension ) {
    235                         os << std::endl << indent << "... with extension";
     246                        os << endl << indent << "... with extension";
    236247                }
    237248        }
     
    378389
    379390        virtual const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) {
    380                 os << "CompoundStmt" << endl;
     391                os << "Compound Statement:" << endl;
    381392                ++indent;
    382393                printAll( node->kids );
     
    396407                os << "Assembler Statement:" << endl;
    397408                ++indent;
    398                 os << indent << "instruction: " << endl << indent;
    399                 node->instruction->accept( *this );
     409                os << indent-1 << "instruction:" << endl << indent;
     410                safe_print( node->instruction );
    400411                if ( ! node->output.empty() ) {
    401                         os << endl << indent+1 << "output: " << endl;
     412                        os << endl << indent << "output:" << endl;
    402413                        printAll( node->output );
    403414                } // if
    404415                if ( ! node->input.empty() ) {
    405                         os << indent+1 << "input: " << endl;
     416                        os << indent << "input:" << endl;
    406417                        printAll( node->input );
    407418                } // if
    408419                if ( ! node->clobber.empty() ) {
    409                         os << indent+1 << "clobber: " << endl;
     420                        os << indent << "clobber:" << endl;
    410421                        printAll( node->clobber );
    411422                } // if
     
    415426
    416427        virtual const ast::Stmt * visit( const ast::DirectiveStmt * node ) {
    417                 os << "GCC Directive:" << node->directive << endl;
     428                os << "GCC Directive: " << node->directive << endl;
    418429                return node;
    419430        }
    420431
    421432        virtual const ast::Stmt * visit( const ast::IfStmt * node ) {
    422                 os << "If on condition: " << endl;
    423                 os << indent+1;
    424                 ++indent;
     433                os << "If on condition:" << endl;
     434                ++indent;
     435                os << indent;
    425436                safe_print( node->cond );
    426437                --indent;
    427438
    428                 if ( !node->inits.empty() ) {
    429                         os << indent << "... with initialization: \n";
    430                         ++indent;
    431                         for ( const Stmt * stmt : node->inits ) {
     439                if ( ! node->inits.empty() ) {
     440                        os << indent << "... with initialization:" << endl;
     441                        ++indent;
     442                        for ( const ast::Stmt * stmt : node->inits ) {
    432443                                os << indent;
    433                                 stmt->accept( *this );
     444                                safe_print( stmt );
    434445                        }
    435446                        --indent;
     
    437448                }
    438449
    439                 os << indent << "... then: " << endl;
     450                os << indent << "... then:" << endl;
    440451
    441452                ++indent;
     
    445456
    446457                if ( node->elsePart != 0 ) {
    447                         os << indent << "... else: " << endl;
     458                        os << indent << "... else:" << endl;
    448459                        ++indent;
    449460                        os << indent;
     
    455466
    456467        virtual const ast::Stmt * visit( const ast::WhileStmt * node ) {
     468                if ( node->isDoWhile ) { os << "Do-"; }
     469                os << "While on condition:" << endl;
     470                ++indent;
     471                safe_print( node->cond );
     472                os << indent-1 << "... with body:" << endl;
     473                safe_print( node->body );
     474
     475                if ( ! node->inits.empty() ) {
     476                        os << indent-1 << "... with inits:" << endl;
     477                        printAll( node->inits );
     478                }
     479                --indent;
     480
    457481                return node;
    458482        }
    459483
    460484        virtual const ast::Stmt * visit( const ast::ForStmt * node ) {
     485                os << "For Statement" << endl;
     486
     487                if ( ! node->inits.empty() ) {
     488                        os << indent << "... initialization:" << endl;
     489                        ++indent;
     490                        for ( const ast::Stmt * stmt : node->inits ) {
     491                                os << indent+1;
     492                                safe_print( stmt );
     493                        }
     494                        --indent;
     495                }
     496
     497                if ( node->cond ) {
     498                        os << indent << "... condition:" << endl;
     499                        ++indent;
     500                        os << indent;
     501                        node->cond->accept( *this );
     502                        --indent;
     503                }
     504
     505                if ( node->inc ) {
     506                        os << indent << "... increment:" << endl;
     507                        ++indent;
     508                        os << indent;
     509                        node->inc->accept( *this );
     510                        --indent;
     511                }
     512
     513                if ( node->body ) {
     514                        os << indent << "... with body:" << endl;
     515                        ++indent;
     516                        os << indent;
     517                        node->body->accept( *this );
     518                        --indent;
     519                }
     520                os << endl;
     521                print( node->labels );
     522
    461523                return node;
    462524        }
    463525
    464526        virtual const ast::Stmt * visit( const ast::SwitchStmt * node ) {
     527                os << "Switch on condition: ";
     528                safe_print( node->cond );
     529                os << endl;
     530
     531                ++indent;
     532                for ( const ast::Stmt * stmt : node->stmts ) {
     533                        stmt->accept( *this );
     534                }
     535                --indent;
     536
    465537                return node;
    466538        }
    467539
    468540        virtual const ast::Stmt * visit( const ast::CaseStmt * node ) {
     541                if ( node->isDefault() ) {
     542                        os << indent << "Default ";
     543                } else {
     544                        os << indent << "Case ";
     545                        safe_print( node->cond );
     546                } // if
     547                os << endl;
     548
     549                ++indent;
     550                for ( const ast::Stmt * stmt : node->stmts ) {
     551                        os << indent;
     552                        stmt->accept( *this );
     553                }
     554                --indent;
     555
    469556                return node;
    470557        }
    471558
    472559        virtual const ast::Stmt * visit( const ast::BranchStmt * node ) {
     560                os << "Branch (" << node->kindName() << ")" << endl;
     561                ++indent;
     562                if ( ! node->target.empty() ) {
     563                        os << indent << "with target: " << node->target << endl;
     564                }
     565
     566                if ( ! node->originalTarget.empty() ) {
     567                        os << indent << "with original target: " << node->originalTarget << endl;
     568                }
     569
     570                if ( node->computedTarget ) {
     571                        os << indent << "with computed target: ";
     572                        node->computedTarget->accept( *this );
     573                        os << endl;
     574                }
     575                --indent;
     576
    473577                return node;
    474578        }
    475579
    476580        virtual const ast::Stmt * visit( const ast::ReturnStmt * node ) {
     581                os << "Return Statement, returning";
     582                if ( node->expr ) {
     583                        ++indent;
     584                        os << ":" << endl << indent;
     585                        node->expr->accept( *this );
     586                        --indent;
     587                } else {
     588                        os << " void";
     589                }
     590                os << endl;
     591
    477592                return node;
    478593        }
     
    503618
    504619        virtual const ast::NullStmt * visit( const ast::NullStmt * node ) {
     620                os << "Null Statement" << endl;
     621                print( node->labels );
     622
    505623                return node;
    506624        }
     
    516634        virtual const ast::Expr * visit( const ast::ApplicationExpr * node ) {
    517635                ++indent;
    518                 os << "Application of" << std::endl << indent;
     636                os << "Application of" << endl << indent;
    519637                safe_print( node->func );
    520                 os << std::endl;
     638                os << endl;
    521639                if ( ! node->args.empty() ) {
    522                         os << indent << "... to arguments" << std::endl;
     640                        os << indent << "... to arguments" << endl;
    523641                        printAll( node->args );
    524642                }
     
    531649        virtual const ast::Expr * visit( const ast::UntypedExpr * node ) {
    532650                ++indent;
    533                 os << "Applying untyped:" << std::endl;
     651                os << "Applying untyped:" << endl;
    534652                os << indent;
    535653                safe_print( node->func );
    536                 os << std::endl << indent-1 << "...to:" << std::endl;
     654                os << endl << indent-1 << "...to:" << endl;
    537655                printAll( node->args );
    538656                --indent;
     
    550668
    551669        virtual const ast::Expr * visit( const ast::AddressExpr * node ) {
    552                 os << "Address of:" << std::endl;
     670                os << "Address of:" << endl;
    553671                ++indent;
    554672                os << indent;
     
    568686        virtual const ast::Expr * visit( const ast::CastExpr * node ) {
    569687                ++indent;
    570                 os << (node->isGenerated ? "Generated" : "Explicit") << " cast of:" << std::endl << indent;
     688                os << (node->isGenerated ? "Generated" : "Explicit") << " cast of:" << endl << indent;
    571689                safe_print( node->arg );
    572                 os << std::endl << indent-1 << "... to:";
     690                os << endl << indent-1 << "... to:";
    573691                if ( ! node->result ) {
    574692                        os << " ";
     
    577695                        os << " nothing";
    578696                } else {
    579                         os << std::endl << indent;
     697                        os << endl << indent;
    580698                        node->result->accept( *this );
    581699                } // if
     
    588706        virtual const ast::Expr * visit( const ast::KeywordCastExpr * node ) {
    589707                ++indent;
    590                 os << "Keyword Cast of:" << std::endl << indent;
     708                os << "Keyword Cast of:" << endl << indent;
    591709                safe_print( node->arg );
    592710                --indent;
    593                 os << std::endl << indent << "... to: " << node->targetString();
     711                os << endl << indent << "... to: " << node->targetString();
    594712                postprint( node );
    595713
     
    599717        virtual const ast::Expr * visit( const ast::VirtualCastExpr * node ) {
    600718                ++indent;
    601                 os << "Virtual Cast of:" << std::endl << indent;
     719                os << "Virtual Cast of:" << endl << indent;
    602720                safe_print( node->arg );
    603                 os << std::endl << indent-1 << "... to:";
     721                os << endl << indent-1 << "... to:";
    604722                if ( ! node->result ) {
    605723                        os << " unknown";
    606724                } else {
    607                         os << std::endl << indent;
     725                        os << endl << indent;
    608726                        node->result->accept( *this );
    609727                }
     
    616734        virtual const ast::Expr * visit( const ast::UntypedMemberExpr * node ) {
    617735                ++indent;
    618                 os << "Untyped Member Expression, with field: " << std::endl << indent;
     736                os << "Untyped Member Expression, with field: " << endl << indent;
    619737                safe_print( node->member );
    620                 os << indent-1 << "... from aggregate:" << std::endl << indent;
     738                os << indent-1 << "... from aggregate:" << endl << indent;
    621739                safe_print( node->aggregate );
    622740                --indent;
     
    628746        virtual const ast::Expr * visit( const ast::MemberExpr * node ) {
    629747                ++indent;
    630                 os << "Member Expression, with field:" << std::endl << indent;
     748                os << "Member Expression, with field:" << endl << indent;
    631749                safe_print( node->member );
    632                 os << std::endl << indent-1 << "... from aggregate:" << std::endl << indent;
     750                os << endl << indent-1 << "... from aggregate:" << endl << indent;
    633751                safe_print( node->aggregate );
    634752                --indent;
     
    722840        virtual const ast::Expr * visit( const ast::ConditionalExpr * node ) {
    723841                ++indent;
    724                 os << "Conditional expression on:" << std::endl << indent;
     842                os << "Conditional expression on:" << endl << indent;
    725843                safe_print( node->arg1 );
    726                 os << indent-1 << "First alternative:" << std::endl << indent;
     844                os << indent-1 << "First alternative:" << endl << indent;
    727845                safe_print( node->arg2 );
    728                 os << indent-1 << "Second alternative:" << std::endl << indent;
     846                os << indent-1 << "Second alternative:" << endl << indent;
    729847                safe_print( node->arg3 );
    730848                --indent;
     
    736854        virtual const ast::Expr * visit( const ast::CommaExpr * node ) {
    737855                ++indent;
    738                 os << "Comma Expression:" << std::endl << indent;
     856                os << "Comma Expression:" << endl << indent;
    739857                safe_print( node->arg1 );
    740                 os << std::endl << indent;
     858                os << endl << indent;
    741859                safe_print( node->arg2 );
    742860                --indent;
     
    754872
    755873        virtual const ast::Expr * visit( const ast::AsmExpr * node ) {
    756                 os << "Asm Expression:" << std::endl;
     874                os << "Asm Expression:" << endl;
    757875                ++indent;
    758876                if ( node->inout ) node->inout->accept( *this );
     
    766884        virtual const ast::Expr * visit( const ast::ImplicitCopyCtorExpr * node ) {
    767885                ++indent;
    768                 os << "Implicit Copy Constructor Expression:" << std::endl << indent;
     886                os << "Implicit Copy Constructor Expression:" << endl << indent;
    769887                safe_print( node->callExpr );
    770                 os << std::endl << indent-1 << "... with temporaries:" << std::endl;
     888                os << endl << indent-1 << "... with temporaries:" << endl;
    771889                printAll( node->tempDecls );
    772                 os << std::endl << indent-1 << "... with return temporaries:" << std::endl;
     890                os << endl << indent-1 << "... with return temporaries:" << endl;
    773891                printAll( node->returnDecls );
    774892                --indent;
     
    779897
    780898        virtual const ast::Expr * visit( const ast::ConstructorExpr * node ) {
    781                 os <<  "Constructor Expression:" << std::endl << indent+1;
     899                os <<  "Constructor Expression:" << endl << indent+1;
    782900                indent += 2;
    783901                safe_print( node->callExpr );
     
    790908        virtual const ast::Expr * visit( const ast::CompoundLiteralExpr * node ) {
    791909                ++indent;
    792                 os << "Compound Literal Expression: " << std::endl << indent;
     910                os << "Compound Literal Expression: " << endl << indent;
    793911                safe_print( node->result );
    794912                os << indent;
     
    811929
    812930        virtual const ast::Expr * visit( const ast::UntypedTupleExpr * node ) {
    813                 os << "Untyped Tuple:" << std::endl;
     931                os << "Untyped Tuple:" << endl;
    814932                ++indent;
    815933                printAll( node->exprs );
     
    821939
    822940        virtual const ast::Expr * visit( const ast::TupleExpr * node ) {
    823                 os << "Tuple:" << std::endl;
     941                os << "Tuple:" << endl;
    824942                ++indent;
    825943                printAll( node->exprs );
     
    831949
    832950        virtual const ast::Expr * visit( const ast::TupleIndexExpr * node ) {
    833                 os << "Tuple Index Expression, with tuple:" << std::endl;
     951                os << "Tuple Index Expression, with tuple:" << endl;
    834952                ++indent;
    835953                os << indent;
    836954                safe_print( node->tuple );
    837                 os << indent << "with index: " << node->index << std::endl;
     955                os << indent << "with index: " << node->index << endl;
    838956                --indent;
    839957                postprint( node );
     
    843961
    844962        virtual const ast::Expr * visit( const ast::TupleAssignExpr * node ) {
    845                 os << "Tuple Assignment Expression, with stmt expr:" << std::endl;
     963                os << "Tuple Assignment Expression, with stmt expr:" << endl;
    846964                ++indent;
    847965                os << indent;
     
    855973        virtual const ast::Expr * visit( const ast::StmtExpr * node ) {
    856974                ++indent;
    857                 os << "Statement Expression:" << std::endl << indent;
     975                os << "Statement Expression:" << endl << indent;
    858976                safe_print( node->stmts );
    859977                if ( ! node->returnDecls.empty() ) {
     
    873991        virtual const ast::Expr * visit( const ast::UniqueExpr * node ) {
    874992                ++indent;
    875                 os << "Unique Expression with id: " << node->id << std::endl << indent;
     993                os << "Unique Expression with id: " << node->id << endl << indent;
    876994                safe_print( node->expr );
    877995                if ( node->object ) {
     
    8871005        virtual const ast::Expr * visit( const ast::UntypedInitExpr * node ) {
    8881006                ++indent;
    889                 os << "Untyped Init Expression" << std::endl << indent;
     1007                os << "Untyped Init Expression" << endl << indent;
    8901008                safe_print( node->expr );
    8911009                if ( ! node->initAlts.empty() ) {
     
    9031021        virtual const ast::Expr * visit( const ast::InitExpr * node ) {
    9041022                ++indent;
    905                 os << "Init Expression" << std::endl << indent;
     1023                os << "Init Expression" << endl << indent;
    9061024                safe_print( node->expr );
    9071025                os << indent << "... with designation: ";
     
    9141032        virtual const ast::Expr * visit( const ast::DeletedExpr * node ) {
    9151033                ++indent;
    916                 os << "Deleted Expression" << std::endl << indent;
     1034                os << "Deleted Expression" << endl << indent;
    9171035                safe_print( node->expr );
    918                 os << std::endl << indent << "... deleted by: ";
     1036                os << endl << indent << "... deleted by: ";
    9191037                safe_print( node->deleteStmt );
    9201038                --indent;
     
    9251043        virtual const ast::Expr * visit( const ast::DefaultArgExpr * node ) {
    9261044                ++indent;
    927                 os << "Default Argument Expression" << std::endl << indent;
     1045                os << "Default Argument Expression" << endl << indent;
    9281046                safe_print( node->expr );
    9291047                --indent;
     
    9341052        virtual const ast::Expr * visit( const ast::GenericExpr * node ) {
    9351053                ++indent;
    936                 os << "C11 _Generic Expression" << std::endl << indent;
     1054                os << "C11 _Generic Expression" << endl << indent;
    9371055                safe_print( node->control );
    938                 os << std::endl << indent << "... with associations:" << std::endl;
     1056                os << endl << indent << "... with associations:" << endl;
    9391057                for ( const auto & assoc : node->associations ) {
    9401058                        os << indent;
     
    9421060                                os << "... type: ";
    9431061                                assoc.type->accept( *this );
    944                                 os << std::endl << indent << "... expression: ";
     1062                                os << endl << indent << "... expression: ";
    9451063                                safe_print( assoc.expr );
    9461064                        } else {
     
    9481066                                safe_print( assoc.expr );
    9491067                        }
    950                         os << std::endl;
     1068                        os << endl;
    9511069                }
    9521070                --indent;
     
    10251143                preprint( node );
    10261144                ++indent;
    1027                 os << "Qualified Type:" << std::endl << indent;
     1145                os << "Qualified Type:" << endl << indent;
    10281146                safe_print( node->parent );
    1029                 os << std::endl << indent;
     1147                os << endl << indent;
    10301148                safe_print( node->child );
    1031                 os << std::endl;
     1149                os << endl;
    10321150                --indent;
    10331151
     
    10381156                preprint( node );
    10391157               
    1040                 os << "function" << std::endl;
     1158                os << "function" << endl;
    10411159                if ( ! node->params.empty() ) {
    1042                         os << indent << "... with parameters" << std::endl;
     1160                        os << indent << "... with parameters" << endl;
    10431161                        ++indent;
    10441162                        printAll( node->params );
    10451163                        if ( node->isVarArgs ) {
    1046                                 os << indent << "and a variable number of other arguments" << std::endl;
     1164                                os << indent << "and a variable number of other arguments" << endl;
    10471165                        }
    10481166                        --indent;
    10491167                } else if ( node->isVarArgs ) {
    1050                         os << indent+1 << "accepting unspecified arguments" << std::endl;
     1168                        os << indent+1 << "accepting unspecified arguments" << endl;
    10511169                }
    10521170
    10531171                os << indent << "... returning";
    10541172                if ( node->returns.empty() ) {
    1055                         os << " nothing" << std::endl;
     1173                        os << " nothing" << endl;
    10561174                } else {
    1057                         os << std::endl;
     1175                        os << endl;
    10581176                        ++indent;
    10591177                        printAll( node->returns );
     
    11161234        virtual const ast::Type * visit( const ast::TupleType * node ) {
    11171235                preprint( node );
    1118                 os << "tuple of types" << std::endl;
     1236                os << "tuple of types" << endl;
    11191237                ++indent;
    11201238                printAll( node->types );
     
    11591277        virtual const ast::Designation * visit( const ast::Designation * node ) {
    11601278                if ( node->designators.empty() ) return node;
    1161                 os << "... designated by: " << std::endl;
     1279                os << "... designated by: " << endl;
    11621280                ++indent;
    11631281                for ( const ast::Expr * d : node->designators ) {
    11641282                        os << indent;
    11651283                        d->accept( *this );
    1166                         os << std::endl;
     1284                        os << endl;
    11671285                }
    11681286                --indent;
     
    11771295
    11781296        virtual const ast::Init * visit( const ast::ListInit * node ) {
    1179                 os << "Compound initializer: " << std::endl;
     1297                os << "Compound initializer: " << endl;
    11801298                ++indent;
    11811299                for ( auto p : group_iterate( node->designations, node->initializers ) ) {
     
    11841302                        os << indent;
    11851303                        init->accept( *this );
    1186                         os << std::endl;
     1304                        os << endl;
    11871305                        if ( ! d->designators.empty() ) {
    11881306                                os << indent;
     
    11951313
    11961314        virtual const ast::Init * visit( const ast::ConstructorInit * node ) {
    1197                 os << "Constructor initializer: " << std::endl;
     1315                os << "Constructor initializer: " << endl;
    11981316                if ( node->ctor ) {
    11991317                        os << indent << "... initially constructed with ";
     
    12231341                os << "Attribute with name: " << node->name;
    12241342                if ( node->params.empty() ) return node;
    1225                 os << " with parameters: " << std::endl;
     1343                os << " with parameters: " << endl;
    12261344                ++indent;
    12271345                printAll( node->params );
     
    12311349
    12321350        virtual const ast::TypeSubstitution * visit( const ast::TypeSubstitution * node ) {
    1233                 os << indent << "Types:" << std::endl;
     1351                os << indent << "Types:" << endl;
    12341352                for ( const auto& i : *node ) {
    12351353                        os << indent+1 << i.first << " -> ";
     
    12371355                        safe_print( i.second );
    12381356                        indent -= 2;
    1239                         os << std::endl;
    1240                 }
    1241                 os << indent << "Non-types:" << std::endl;
     1357                        os << endl;
     1358                }
     1359                os << indent << "Non-types:" << endl;
    12421360                for ( auto i = node->beginVar(); i != node->endVar(); ++i ) {
    12431361                        os << indent+1 << i->first << " -> ";
     
    12451363                        safe_print( i->second );
    12461364                        indent -= 2;
    1247                         os << std::endl;
     1365                        os << endl;
    12481366                }
    12491367                return node;
  • src/AST/Stmt.hpp

    ra16e246 r94b1f718  
    244244          computedTarget(computedTarget), kind(Goto) {}
    245245
    246         const char * kindName() { return kindNames[kind]; }
     246        const char * kindName() const { return kindNames[kind]; }
    247247
    248248        const Stmt * accept( Visitor & v ) const override { return v.visit( this ); }
Note: See TracChangeset for help on using the changeset viewer.