Changes in / [b3f252a:416cc86]


Ignore:
Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    rb3f252a r416cc86  
    277277        ~ValueGuardPtr() { if( ref ) *ref = old; }
    278278};
    279 
    280 template< typename aT >
    281 struct 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 
    294 template< typename bT, typename aT >
    295 FuncGuard<aT> makeFuncGuard( bT && before, aT && after ) {
    296         return FuncGuard<aT>( std::forward<bT>(before), std::forward<aT>(after) );
    297 }
    298279
    299280template< typename T >
  • src/SynTree/Declaration.h

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

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

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

    rb3f252a r416cc86  
    155155  public:
    156156        Expression * condition;
    157         std::list<Statement *> statements;
    158157
    159158        SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements );
     
    171170        virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); }
    172171        virtual void print( std::ostream &os, int indent = 0 ) const;
    173 
     172  private:
     173        std::list<Statement *> statements;
    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.