Changeset e4bc986


Ignore:
Timestamp:
Dec 4, 2017, 11:07:23 AM (7 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

Location:
src
Files:
2 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;
  • src/tests/.expect/declarationErrors.txt

    ra40d503 re4bc986  
    77declarationErrors.c:19:1 error: duplicate static in declaration of x4: static const volatile instance of const volatile struct __anonymous0
    88  with members
     9    i: int
    910   with body
    1011
     
    1213declarationErrors.c:20:1 error: duplicate const, duplicate static, duplicate volatile in declaration of x5: static const volatile instance of const volatile struct __anonymous1
    1314  with members
     15    i: int
    1416   with body
    1517
Note: See TracChangeset for help on using the changeset viewer.