Changes in / [416cc86:b3f252a]


Ignore:
Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    r416cc86 rb3f252a  
    277277        ~ValueGuardPtr() { if( ref ) *ref = old; }
    278278};
     279
     280template< typename aT >
     281struct FuncGuard {
     282        aT m_after;
     283
     284        template< typename bT >
     285        FuncGuard( bT before, aT after ) : m_after( after ) {
     286                before();
     287        }
     288
     289        ~FuncGuard() {
     290                m_after();
     291        }
     292};
     293
     294template< typename bT, typename aT >
     295FuncGuard<aT> makeFuncGuard( bT && before, aT && after ) {
     296        return FuncGuard<aT>( std::forward<bT>(before), std::forward<aT>(after) );
     297}
    279298
    280299template< typename T >
  • src/SynTree/Declaration.h

    r416cc86 rb3f252a  
    155155        virtual ~FunctionDecl();
    156156
    157         Type * get_type() const;
    158         virtual void set_type(Type *);
     157        Type * get_type() const { return type; }
     158        virtual void set_type(Type * t) { type = safe_dynamic_cast< FunctionType* >( t ); }
    159159
    160160        FunctionType * get_functionType() const { return type; }
  • src/SynTree/Expression.h

    r416cc86 rb3f252a  
    8686  public:
    8787        Expression * function;
     88        std::list<Expression *> args;
     89        InferredParams inferParams;
    8890
    8991        ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
     
    100102        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
    101103        virtual void print( std::ostream & os, int indent = 0 ) const;
    102 
    103   private:
    104         std::list<Expression *> args;
    105         InferredParams inferParams;
    106104};
    107105
  • src/SynTree/FunctionDecl.cc

    r416cc86 rb3f252a  
    4444        delete type;
    4545        delete statements;
    46 }
    47 
    48 Type * FunctionDecl::get_type() const {
    49         return type;
    50 }
    51 
    52 void FunctionDecl::set_type( Type *t ) {
    53         type = dynamic_cast< FunctionType* >( t );
    54         assert( type );
    5546}
    5647
  • src/SynTree/Statement.h

    r416cc86 rb3f252a  
    155155  public:
    156156        Expression * condition;
     157        std::list<Statement *> statements;
    157158
    158159        SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements );
     
    170171        virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); }
    171172        virtual void print( std::ostream &os, int indent = 0 ) const;
    172   private:
    173         std::list<Statement *> statements;
     173
    174174};
    175175
     
    327327class TryStmt : public Statement {
    328328  public:
    329         CompoundStmt *block;
     329        CompoundStmt * block;
    330330        std::list<CatchStmt *> handlers;
    331         FinallyStmt *finallyBlock;
     331        FinallyStmt * finallyBlock;
    332332
    333333        TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 );
Note: See TracChangeset for help on using the changeset viewer.