Changes in / [eba615c:c519942]


Ignore:
Location:
src/AST
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    reba615c rc519942  
    1010// Created On       : Thu May 09 15::37::05 2019
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue May 28 12:00:00 2019
    13 // Update Count     : 7
     12// Last Modified On : Thu May 23 16:59:00 2019
     13// Update Count     : 6
    1414//
    1515
     
    13411341                if ( ! old ) return nullptr;
    13421342                old->accept(*this);
    1343                 ast::Node * ret = node;
    1344                 node = nullptr;
    1345                 return strict_dynamic_cast< NewT * >( ret );
     1343                return strict_dynamic_cast< NewT * >( node );
    13461344        }
    13471345
     
    13561354                        a->accept( *this );
    13571355                        ret.emplace_back( strict_dynamic_cast< NewT * >(node) );
    1358                         node = nullptr;
    13591356                }
    13601357                return ret;
     
    18801877                        GET_LABELS_V(old->labels)
    18811878                );
    1882                 cache.emplace( old, stmt );
     1879                this->node = stmt;
     1880                cache.emplace( old, this->node );
    18831881                stmt->callStmt = GET_ACCEPT_1(callStmt, Stmt);
    1884                 this->node = stmt;
    18851882        }
    18861883
  • src/AST/Print.cpp

    reba615c rc519942  
    132132                case ast::Expr::InferUnion::Empty: return;
    133133                case ast::Expr::InferUnion::Slots: {
    134                         os << indent << "with " << inferred.data.resnSlots.size()
     134                        os << indent << "with " << inferred.data.resnSlots.size() 
    135135                           << " pending inference slots" << endl;
    136136                        return;
     
    152152
    153153        void print( const ast::ParameterizedType::ForallList & forall ) {
    154                 if ( forall.empty() ) return;
     154                if ( forall.empty() ) return;   
    155155                os << "forall" << endl;
    156156                ++indent;
     
    178178        void print( const ast::AggregateDecl * node ) {
    179179                os << node->typeString() << " " << node->name;
    180 
     180               
    181181                if ( ! short_mode && node->linkage != Linkage::Cforall ) {
    182182                        os << " " << Linkage::name( node->linkage );
    183183                }
    184 
     184               
    185185                os << " " << (node->body ? "with" : "without") << " body";
    186186
     
    218218                print( node->storage );
    219219                os << node->typeString();
    220 
     220               
    221221                if ( node->base ) {
    222222                        os << " for ";
     
    623623        virtual const ast::Stmt * visit( const ast::TryStmt * node ) {
    624624                ++indent;
    625                 os << "Try Statement" << endl << indent-1
     625                os << "Try Statement" << endl << indent-1 
    626626                   << "... with block:" << endl << indent;
    627627                safe_print( node->body );
     
    663663                safe_print( node->body );
    664664                --indent;
    665 
     665               
    666666                return node;
    667667        }
     
    684684                        os << indent-1 << "target function: ";
    685685                        safe_print( clause.target.func );
    686 
     686                       
    687687                        if ( ! clause.target.args.empty() ) {
    688688                                os << endl << indent-1 << "... with arguments:" << endl;
     
    800800                os << "Name: " << node->name;
    801801                postprint( node );
    802 
     802               
    803803                return node;
    804804        }
     
    931931                --indent;
    932932                postprint( node );
    933 
     933               
    934934                return node;
    935935        }
     
    10151015                if ( node->operand ) node->operand->accept( *this );
    10161016                --indent;
    1017 
     1017               
    10181018                return node;
    10191019        }
     
    10931093                --indent;
    10941094                postprint( node );
    1095 
     1095               
    10961096                return node;
    10971097        }
     
    12921292        virtual const ast::Type * visit( const ast::FunctionType * node ) {
    12931293                preprint( node );
    1294 
     1294               
    12951295                os << "function" << endl;
    12961296                if ( ! node->params.empty() ) {
     
    13621362        virtual const ast::Type * visit( const ast::TypeInstType * node ) {
    13631363                preprint( node );
    1364                 os << "instance of type " << node->name
     1364                os << "instance of type " << node->name 
    13651365                   << " (" << (node->kind == ast::TypeVar::Ftype ? "" : "not ") << "function type)";
    13661366                print( node->params );
  • src/AST/Stmt.hpp

    reba615c rc519942  
    278278        ExceptionKind kind;
    279279
    280         ThrowStmt(
     280        ThrowStmt( 
    281281                const CodeLocation & loc, ExceptionKind kind, const Expr * expr, const Expr * target,
    282282                std::vector<Label> && labels = {} )
     
    296296        ptr<FinallyStmt> finally;
    297297
    298         TryStmt(
     298        TryStmt( 
    299299                const CodeLocation & loc, const CompoundStmt * body,
    300300                std::vector<ptr<CatchStmt>> && handlers, const FinallyStmt * finally,
     
    316316        ExceptionKind kind;
    317317
    318         CatchStmt(
     318        CatchStmt( 
    319319                const CodeLocation & loc, ExceptionKind kind, const Decl * decl, const Expr * cond,
    320320                const Stmt * body, std::vector<Label> && labels = {} )
Note: See TracChangeset for help on using the changeset viewer.