Changeset 6137fbb for src/SynTree


Ignore:
Timestamp:
Oct 19, 2017, 11:13:11 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:
bd7e609
Parents:
0a22cda
git-author:
Rob Schluntz <rschlunt@…> (10/11/17 15:59:22)
git-committer:
Rob Schluntz <rschlunt@…> (10/19/17 11:13:11)
Message:

Print EnumInstType? body flag and other minor cleanup

Location:
src/SynTree
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ReferenceToType.cc

    r0a22cda r6137fbb  
    129129bool EnumInstType::isComplete() const { return baseEnum ? baseEnum->has_body() : false; }
    130130
     131void EnumInstType::print( std::ostream &os, Indenter indent ) const {
     132        using std::endl;
     133
     134        if ( baseEnum == nullptr ) ReferenceToType::print( os, indent );
     135        else {
     136                Type::print( os, indent );
     137                os << "instance of " << typeString() << " " << name << " with body " << baseEnum->has_body() << " ";
     138        } // if
     139}
     140
     141
    131142std::string TraitInstType::typeString() const { return "trait"; }
    132143
  • src/SynTree/Type.h

    r0a22cda r6137fbb  
    466466        virtual void accept( Visitor & v ) override { v.visit( this ); }
    467467        virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); }
     468
     469        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    468470  private:
    469471        virtual std::string typeString() const override;
Note: See TracChangeset for help on using the changeset viewer.