Changes in src/AST/Print.cpp [20a5977:94b1f718]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Print.cpp
r20a5977 r94b1f718 118 118 } 119 119 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 120 131 void print( const ast::Expr::InferUnion & inferred, unsigned level = 0 ) { 121 132 switch ( inferred.mode ) { 122 133 case ast::Expr::InferUnion::Empty: return; 123 134 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; 126 137 return; 127 138 } 128 139 case ast::Expr::InferUnion::Params: { 129 os << indent << "with inferred parameters " << level << ":" << std::endl;140 os << indent << "with inferred parameters " << level << ":" << endl; 130 141 ++indent; 131 142 for ( const auto & i : inferred.data.inferParams ) { 132 143 os << indent; 133 144 short_print( Decl::fromId( i.second.decl ) ); 134 os << std::endl;145 os << endl; 135 146 print( i.second.expr->inferred, level+1 ); 136 147 } … … 143 154 void print( const ast::ParameterizedType::ForallList & forall ) { 144 155 if ( forall.empty() ) return; 145 os << "forall" << std::endl;156 os << "forall" << endl; 146 157 ++indent; 147 158 printAll( forall ); … … 152 163 void print( const std::vector<ptr<Attribute>> & attrs ) { 153 164 if ( attrs.empty() ) return; 154 os << "with attributes" << std::endl;165 os << "with attributes" << endl; 155 166 ++indent; 156 167 printAll( attrs ); … … 160 171 void print( const std::vector<ptr<Expr>> & params ) { 161 172 if ( params.empty() ) return; 162 os << std::endl << indent << "... with parameters" << std::endl;173 os << endl << indent << "... with parameters" << endl; 163 174 ++indent; 164 175 printAll( params ); … … 226 237 227 238 if ( node->env ) { 228 os << std::endl << indent << "... with environment:" << std::endl;239 os << endl << indent << "... with environment:" << endl; 229 240 ++indent; 230 241 node->env->accept( *this ); 231 242 --indent; 232 243 } 233 244 234 245 if ( node->extension ) { 235 os << std::endl << indent << "... with extension";246 os << endl << indent << "... with extension"; 236 247 } 237 248 } … … 378 389 379 390 virtual const ast::CompoundStmt * visit( const ast::CompoundStmt * node ) { 380 os << "Compound Stmt" << endl;391 os << "Compound Statement:" << endl; 381 392 ++indent; 382 393 printAll( node->kids ); … … 396 407 os << "Assembler Statement:" << endl; 397 408 ++indent; 398 os << indent << "instruction:" << endl << indent;399 node->instruction->accept( *this);409 os << indent-1 << "instruction:" << endl << indent; 410 safe_print( node->instruction ); 400 411 if ( ! node->output.empty() ) { 401 os << endl << indent +1 << "output:" << endl;412 os << endl << indent << "output:" << endl; 402 413 printAll( node->output ); 403 414 } // if 404 415 if ( ! node->input.empty() ) { 405 os << indent +1 << "input:" << endl;416 os << indent << "input:" << endl; 406 417 printAll( node->input ); 407 418 } // if 408 419 if ( ! node->clobber.empty() ) { 409 os << indent +1 << "clobber:" << endl;420 os << indent << "clobber:" << endl; 410 421 printAll( node->clobber ); 411 422 } // if … … 415 426 416 427 virtual const ast::Stmt * visit( const ast::DirectiveStmt * node ) { 417 os << "GCC Directive: " << node->directive << endl;428 os << "GCC Directive: " << node->directive << endl; 418 429 return node; 419 430 } 420 431 421 432 virtual const ast::Stmt * visit( const ast::IfStmt * node ) { 422 os << "If on condition: 423 os << indent+1;424 ++indent;433 os << "If on condition:" << endl; 434 ++indent; 435 os << indent; 425 436 safe_print( node->cond ); 426 437 --indent; 427 438 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 ) { 432 443 os << indent; 433 s tmt->accept( *this);444 safe_print( stmt ); 434 445 } 435 446 --indent; … … 437 448 } 438 449 439 os << indent << "... then: 450 os << indent << "... then:" << endl; 440 451 441 452 ++indent; … … 445 456 446 457 if ( node->elsePart != 0 ) { 447 os << indent << "... else: 458 os << indent << "... else:" << endl; 448 459 ++indent; 449 460 os << indent; … … 455 466 456 467 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 457 481 return node; 458 482 } 459 483 460 484 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 461 523 return node; 462 524 } 463 525 464 526 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 465 537 return node; 466 538 } 467 539 468 540 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 469 556 return node; 470 557 } 471 558 472 559 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 473 577 return node; 474 578 } 475 579 476 580 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 477 592 return node; 478 593 } … … 503 618 504 619 virtual const ast::NullStmt * visit( const ast::NullStmt * node ) { 620 os << "Null Statement" << endl; 621 print( node->labels ); 622 505 623 return node; 506 624 } … … 516 634 virtual const ast::Expr * visit( const ast::ApplicationExpr * node ) { 517 635 ++indent; 518 os << "Application of" << std::endl << indent;636 os << "Application of" << endl << indent; 519 637 safe_print( node->func ); 520 os << std::endl;638 os << endl; 521 639 if ( ! node->args.empty() ) { 522 os << indent << "... to arguments" << std::endl;640 os << indent << "... to arguments" << endl; 523 641 printAll( node->args ); 524 642 } … … 531 649 virtual const ast::Expr * visit( const ast::UntypedExpr * node ) { 532 650 ++indent; 533 os << "Applying untyped:" << std::endl;651 os << "Applying untyped:" << endl; 534 652 os << indent; 535 653 safe_print( node->func ); 536 os << std::endl << indent-1 << "...to:" << std::endl;654 os << endl << indent-1 << "...to:" << endl; 537 655 printAll( node->args ); 538 656 --indent; … … 550 668 551 669 virtual const ast::Expr * visit( const ast::AddressExpr * node ) { 552 os << "Address of:" << std::endl;670 os << "Address of:" << endl; 553 671 ++indent; 554 672 os << indent; … … 568 686 virtual const ast::Expr * visit( const ast::CastExpr * node ) { 569 687 ++indent; 570 os << (node->isGenerated ? "Generated" : "Explicit") << " cast of:" << std::endl << indent;688 os << (node->isGenerated ? "Generated" : "Explicit") << " cast of:" << endl << indent; 571 689 safe_print( node->arg ); 572 os << std::endl << indent-1 << "... to:";690 os << endl << indent-1 << "... to:"; 573 691 if ( ! node->result ) { 574 692 os << " "; … … 577 695 os << " nothing"; 578 696 } else { 579 os << std::endl << indent;697 os << endl << indent; 580 698 node->result->accept( *this ); 581 699 } // if … … 588 706 virtual const ast::Expr * visit( const ast::KeywordCastExpr * node ) { 589 707 ++indent; 590 os << "Keyword Cast of:" << std::endl << indent;708 os << "Keyword Cast of:" << endl << indent; 591 709 safe_print( node->arg ); 592 710 --indent; 593 os << std::endl << indent << "... to: " << node->targetString();711 os << endl << indent << "... to: " << node->targetString(); 594 712 postprint( node ); 595 713 … … 599 717 virtual const ast::Expr * visit( const ast::VirtualCastExpr * node ) { 600 718 ++indent; 601 os << "Virtual Cast of:" << std::endl << indent;719 os << "Virtual Cast of:" << endl << indent; 602 720 safe_print( node->arg ); 603 os << std::endl << indent-1 << "... to:";721 os << endl << indent-1 << "... to:"; 604 722 if ( ! node->result ) { 605 723 os << " unknown"; 606 724 } else { 607 os << std::endl << indent;725 os << endl << indent; 608 726 node->result->accept( *this ); 609 727 } … … 616 734 virtual const ast::Expr * visit( const ast::UntypedMemberExpr * node ) { 617 735 ++indent; 618 os << "Untyped Member Expression, with field: " << std::endl << indent;736 os << "Untyped Member Expression, with field: " << endl << indent; 619 737 safe_print( node->member ); 620 os << indent-1 << "... from aggregate:" << std::endl << indent;738 os << indent-1 << "... from aggregate:" << endl << indent; 621 739 safe_print( node->aggregate ); 622 740 --indent; … … 628 746 virtual const ast::Expr * visit( const ast::MemberExpr * node ) { 629 747 ++indent; 630 os << "Member Expression, with field:" << std::endl << indent;748 os << "Member Expression, with field:" << endl << indent; 631 749 safe_print( node->member ); 632 os << std::endl << indent-1 << "... from aggregate:" << std::endl << indent;750 os << endl << indent-1 << "... from aggregate:" << endl << indent; 633 751 safe_print( node->aggregate ); 634 752 --indent; … … 659 777 660 778 virtual const ast::Expr * visit( const ast::SizeofExpr * node ) { 779 os << "Sizeof Expression on: "; 780 ++indent; 781 if ( node->type ) node->type->accept( *this ); 782 else safe_print( node->expr ); 783 --indent; 784 postprint( node ); 785 661 786 return node; 662 787 } 663 788 664 789 virtual const ast::Expr * visit( const ast::AlignofExpr * node ) { 790 os << "Alignof Expression on: "; 791 ++indent; 792 if ( node->type ) node->type->accept( *this ); 793 else safe_print( node->expr ); 794 --indent; 795 postprint( node ); 796 665 797 return node; 666 798 } 667 799 668 800 virtual const ast::Expr * visit( const ast::UntypedOffsetofExpr * node ) { 801 os << "Untyped Offsetof Expression on member " << node->member << " of "; 802 ++indent; 803 safe_print( node->type ); 804 --indent; 805 postprint( node ); 806 669 807 return node; 670 808 } 671 809 672 810 virtual const ast::Expr * visit( const ast::OffsetofExpr * node ) { 811 os << "Offsetof Expression on member " << node->member->name << " of "; 812 ++indent; 813 safe_print( node->type ); 814 --indent; 815 postprint( node ); 816 673 817 return node; 674 818 } 675 819 676 820 virtual const ast::Expr * visit( const ast::OffsetPackExpr * node ) { 821 os << "Offset Pack Expression on: "; 822 ++indent; 823 safe_print( node->type ); 824 --indent; 825 postprint( node ); 826 677 827 return node; 678 828 } 679 829 680 830 virtual const ast::Expr * visit( const ast::LogicalExpr * node ) { 831 os << "Short-circuited operation (" << (node->isAnd ? "and" : "or") << ") on: "; 832 safe_print( node->arg1 ); 833 os << " and "; 834 safe_print( node->arg2 ); 835 postprint( node ); 836 681 837 return node; 682 838 } 683 839 684 840 virtual const ast::Expr * visit( const ast::ConditionalExpr * node ) { 841 ++indent; 842 os << "Conditional expression on:" << endl << indent; 843 safe_print( node->arg1 ); 844 os << indent-1 << "First alternative:" << endl << indent; 845 safe_print( node->arg2 ); 846 os << indent-1 << "Second alternative:" << endl << indent; 847 safe_print( node->arg3 ); 848 --indent; 849 postprint( node ); 850 685 851 return node; 686 852 } 687 853 688 854 virtual const ast::Expr * visit( const ast::CommaExpr * node ) { 855 ++indent; 856 os << "Comma Expression:" << endl << indent; 857 safe_print( node->arg1 ); 858 os << endl << indent; 859 safe_print( node->arg2 ); 860 --indent; 861 postprint( node ); 862 689 863 return node; 690 864 } 691 865 692 866 virtual const ast::Expr * visit( const ast::TypeExpr * node ) { 867 safe_print( node->type ); 868 postprint( node ); 869 693 870 return node; 694 871 } 695 872 696 873 virtual const ast::Expr * visit( const ast::AsmExpr * node ) { 874 os << "Asm Expression:" << endl; 875 ++indent; 876 if ( node->inout ) node->inout->accept( *this ); 877 if ( node->constraint ) node->constraint->accept( *this ); 878 if ( node->operand ) node->operand->accept( *this ); 879 --indent; 880 697 881 return node; 698 882 } 699 883 700 884 virtual const ast::Expr * visit( const ast::ImplicitCopyCtorExpr * node ) { 885 ++indent; 886 os << "Implicit Copy Constructor Expression:" << endl << indent; 887 safe_print( node->callExpr ); 888 os << endl << indent-1 << "... with temporaries:" << endl; 889 printAll( node->tempDecls ); 890 os << endl << indent-1 << "... with return temporaries:" << endl; 891 printAll( node->returnDecls ); 892 --indent; 893 postprint( node ); 894 701 895 return node; 702 896 } 703 897 704 898 virtual const ast::Expr * visit( const ast::ConstructorExpr * node ) { 899 os << "Constructor Expression:" << endl << indent+1; 900 indent += 2; 901 safe_print( node->callExpr ); 902 indent -= 2; 903 postprint( node ); 904 705 905 return node; 706 906 } 707 907 708 908 virtual const ast::Expr * visit( const ast::CompoundLiteralExpr * node ) { 909 ++indent; 910 os << "Compound Literal Expression: " << endl << indent; 911 safe_print( node->result ); 912 os << indent; 913 safe_print( node->init ); 914 --indent; 915 postprint( node ); 916 709 917 return node; 710 918 } 711 919 712 920 virtual const ast::Expr * visit( const ast::RangeExpr * node ) { 921 os << "Range Expression: "; 922 safe_print( node->low ); 923 os << " ... "; 924 safe_print( node->high ); 925 postprint( node ); 926 713 927 return node; 714 928 } 715 929 716 930 virtual const ast::Expr * visit( const ast::UntypedTupleExpr * node ) { 931 os << "Untyped Tuple:" << endl; 932 ++indent; 933 printAll( node->exprs ); 934 --indent; 935 postprint( node ); 936 717 937 return node; 718 938 } 719 939 720 940 virtual const ast::Expr * visit( const ast::TupleExpr * node ) { 941 os << "Tuple:" << endl; 942 ++indent; 943 printAll( node->exprs ); 944 --indent; 945 postprint( node ); 946 721 947 return node; 722 948 } 723 949 724 950 virtual const ast::Expr * visit( const ast::TupleIndexExpr * node ) { 951 os << "Tuple Index Expression, with tuple:" << endl; 952 ++indent; 953 os << indent; 954 safe_print( node->tuple ); 955 os << indent << "with index: " << node->index << endl; 956 --indent; 957 postprint( node ); 958 725 959 return node; 726 960 } 727 961 728 962 virtual const ast::Expr * visit( const ast::TupleAssignExpr * node ) { 963 os << "Tuple Assignment Expression, with stmt expr:" << endl; 964 ++indent; 965 os << indent; 966 safe_print( node->stmtExpr ); 967 --indent; 968 postprint( node ); 969 729 970 return node; 730 971 } 731 972 732 973 virtual const ast::Expr * visit( const ast::StmtExpr * node ) { 974 ++indent; 975 os << "Statement Expression:" << endl << indent; 976 safe_print( node->stmts ); 977 if ( ! node->returnDecls.empty() ) { 978 os << indent << "... with returnDecls: "; 979 printAll( node->returnDecls ); 980 } 981 if ( ! node->dtors.empty() ) { 982 os << indent << "... with dtors: "; 983 printAll( node->dtors ); 984 } 985 --indent; 986 postprint( node ); 987 733 988 return node; 734 989 } 735 990 736 991 virtual const ast::Expr * visit( const ast::UniqueExpr * node ) { 992 ++indent; 993 os << "Unique Expression with id: " << node->id << endl << indent; 994 safe_print( node->expr ); 995 if ( node->object ) { 996 os << indent-1 << "... with decl: "; 997 short_print( node->object ); 998 } 999 --indent; 1000 postprint( node ); 1001 737 1002 return node; 738 1003 } 739 1004 740 1005 virtual const ast::Expr * visit( const ast::UntypedInitExpr * node ) { 1006 ++indent; 1007 os << "Untyped Init Expression" << endl << indent; 1008 safe_print( node->expr ); 1009 if ( ! node->initAlts.empty() ) { 1010 for ( const InitAlternative & alt : node->initAlts ) { 1011 os << indent << "InitAlternative: "; 1012 safe_print( alt.type ); 1013 safe_print( alt.designation ); 1014 } 1015 } 1016 --indent; 1017 741 1018 return node; 742 1019 } 743 1020 744 1021 virtual const ast::Expr * visit( const ast::InitExpr * node ) { 1022 ++indent; 1023 os << "Init Expression" << endl << indent; 1024 safe_print( node->expr ); 1025 os << indent << "... with designation: "; 1026 safe_print( node->designation ); 1027 --indent; 1028 745 1029 return node; 746 1030 } 747 1031 748 1032 virtual const ast::Expr * visit( const ast::DeletedExpr * node ) { 1033 ++indent; 1034 os << "Deleted Expression" << endl << indent; 1035 safe_print( node->expr ); 1036 os << endl << indent << "... deleted by: "; 1037 safe_print( node->deleteStmt ); 1038 --indent; 1039 749 1040 return node; 750 1041 } 751 1042 752 1043 virtual const ast::Expr * visit( const ast::DefaultArgExpr * node ) { 1044 ++indent; 1045 os << "Default Argument Expression" << endl << indent; 1046 safe_print( node->expr ); 1047 --indent; 1048 753 1049 return node; 754 1050 } 755 1051 756 1052 virtual const ast::Expr * visit( const ast::GenericExpr * node ) { 1053 ++indent; 1054 os << "C11 _Generic Expression" << endl << indent; 1055 safe_print( node->control ); 1056 os << endl << indent << "... with associations:" << endl; 1057 for ( const auto & assoc : node->associations ) { 1058 os << indent; 1059 if ( assoc.type ) { 1060 os << "... type: "; 1061 assoc.type->accept( *this ); 1062 os << endl << indent << "... expression: "; 1063 safe_print( assoc.expr ); 1064 } else { 1065 os << "... default: "; 1066 safe_print( assoc.expr ); 1067 } 1068 os << endl; 1069 } 1070 --indent; 1071 757 1072 return node; 758 1073 } … … 828 1143 preprint( node ); 829 1144 ++indent; 830 os << "Qualified Type:" << std::endl << indent;1145 os << "Qualified Type:" << endl << indent; 831 1146 safe_print( node->parent ); 832 os << std::endl << indent;1147 os << endl << indent; 833 1148 safe_print( node->child ); 834 os << std::endl;1149 os << endl; 835 1150 --indent; 836 1151 … … 841 1156 preprint( node ); 842 1157 843 os << "function" << std::endl;1158 os << "function" << endl; 844 1159 if ( ! node->params.empty() ) { 845 os << indent << "... with parameters" << std::endl;1160 os << indent << "... with parameters" << endl; 846 1161 ++indent; 847 1162 printAll( node->params ); 848 1163 if ( node->isVarArgs ) { 849 os << indent << "and a variable number of other arguments" << std::endl;1164 os << indent << "and a variable number of other arguments" << endl; 850 1165 } 851 1166 --indent; 852 1167 } else if ( node->isVarArgs ) { 853 os << indent+1 << "accepting unspecified arguments" << std::endl;1168 os << indent+1 << "accepting unspecified arguments" << endl; 854 1169 } 855 1170 856 1171 os << indent << "... returning"; 857 1172 if ( node->returns.empty() ) { 858 os << " nothing" << std::endl;1173 os << " nothing" << endl; 859 1174 } else { 860 os << std::endl;1175 os << endl; 861 1176 ++indent; 862 1177 printAll( node->returns ); … … 919 1234 virtual const ast::Type * visit( const ast::TupleType * node ) { 920 1235 preprint( node ); 921 os << "tuple of types" << std::endl;1236 os << "tuple of types" << endl; 922 1237 ++indent; 923 1238 printAll( node->types ); … … 962 1277 virtual const ast::Designation * visit( const ast::Designation * node ) { 963 1278 if ( node->designators.empty() ) return node; 964 os << "... designated by: " << std::endl;1279 os << "... designated by: " << endl; 965 1280 ++indent; 966 1281 for ( const ast::Expr * d : node->designators ) { 967 1282 os << indent; 968 1283 d->accept( *this ); 969 os << std::endl;1284 os << endl; 970 1285 } 971 1286 --indent; … … 980 1295 981 1296 virtual const ast::Init * visit( const ast::ListInit * node ) { 982 os << "Compound initializer: " << std::endl;1297 os << "Compound initializer: " << endl; 983 1298 ++indent; 984 1299 for ( auto p : group_iterate( node->designations, node->initializers ) ) { … … 987 1302 os << indent; 988 1303 init->accept( *this ); 989 os << std::endl;1304 os << endl; 990 1305 if ( ! d->designators.empty() ) { 991 1306 os << indent; … … 998 1313 999 1314 virtual const ast::Init * visit( const ast::ConstructorInit * node ) { 1000 os << "Constructor initializer: " << std::endl;1315 os << "Constructor initializer: " << endl; 1001 1316 if ( node->ctor ) { 1002 1317 os << indent << "... initially constructed with "; … … 1026 1341 os << "Attribute with name: " << node->name; 1027 1342 if ( node->params.empty() ) return node; 1028 os << " with parameters: " << std::endl;1343 os << " with parameters: " << endl; 1029 1344 ++indent; 1030 1345 printAll( node->params ); … … 1034 1349 1035 1350 virtual const ast::TypeSubstitution * visit( const ast::TypeSubstitution * node ) { 1036 os << indent << "Types:" << std::endl;1351 os << indent << "Types:" << endl; 1037 1352 for ( const auto& i : *node ) { 1038 1353 os << indent+1 << i.first << " -> "; … … 1040 1355 safe_print( i.second ); 1041 1356 indent -= 2; 1042 os << std::endl;1043 } 1044 os << indent << "Non-types:" << std::endl;1357 os << endl; 1358 } 1359 os << indent << "Non-types:" << endl; 1045 1360 for ( auto i = node->beginVar(); i != node->endVar(); ++i ) { 1046 1361 os << indent+1 << i->first << " -> "; … … 1048 1363 safe_print( i->second ); 1049 1364 indent -= 2; 1050 os << std::endl;1365 os << endl; 1051 1366 } 1052 1367 return node;
Note: See TracChangeset
for help on using the changeset viewer.