Changeset e4bc986 for src/Parser


Ignore:
Timestamp:
Dec 4, 2017, 11:07:23 AM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
497282e
Parents:
a40d503
Message:

Add ParseNode? print code and update declarationErrors test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/ParseNode.h

    ra40d503 re4bc986  
    6969
    7070        virtual void print( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const {}
    71         virtual void printList( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const {}
     71        virtual void printList( std::ostream &os, int indent = 0 ) const {
     72                print( os, indent );
     73                if ( next ) next->print( os, indent );
     74        }
    7275
    7376        static int indent_by;
     
    120123        ExpressionNode * set_extension( bool exten ) { extension = exten; return this; }
    121124
    122         virtual void print( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const override {}
     125        virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override {
     126                os << expr.get() << std::endl;
     127        }
    123128        void printOneLine( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const {}
    124129
     
    359364        virtual StatementNode * append_last_case( StatementNode * );
    360365
    361         virtual void print( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const override {}
    362         virtual void printList( __attribute__((unused)) std::ostream &os, __attribute__((unused)) int indent = 0 ) const override {}
     366        virtual void print( std::ostream &os, __attribute__((unused)) int indent = 0 ) const override {
     367                os << stmt.get() << std::endl;
     368        }
    363369  private:
    364370        std::unique_ptr<Statement> stmt;
Note: See TracChangeset for help on using the changeset viewer.