Changes in / [3e3f236:297cf18]


Ignore:
Location:
src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r3e3f236 r297cf18  
    233233        const ast::Decl * namedTypePostamble( NamedTypeDecl * decl, const ast::NamedTypeDecl * node ) {
    234234                // base comes from constructor
     235                decl->parameters = get<TypeDecl>().acceptL( node->params );
    235236                decl->assertions = get<DeclarationWithType>().acceptL( node->assertions );
    236237                declPostamble( decl, node );
     
    17031704                cache.emplace( old, decl );
    17041705                decl->assertions = GET_ACCEPT_V(assertions, DeclWithType);
     1706                decl->params     = GET_ACCEPT_V(parameters, TypeDecl);
    17051707                decl->extension  = old->extension;
    17061708                decl->uniqueId   = old->uniqueId;
     
    17181720                );
    17191721                decl->assertions = GET_ACCEPT_V(assertions, DeclWithType);
     1722                decl->params     = GET_ACCEPT_V(parameters, TypeDecl);
    17201723                decl->extension  = old->extension;
    17211724                decl->uniqueId   = old->uniqueId;
  • src/AST/Decl.hpp

    r3e3f236 r297cf18  
    154154public:
    155155        ptr<Type> base;
     156        std::vector<ptr<TypeDecl>> params;
    156157        std::vector<ptr<DeclWithType>> assertions;
    157158
     
    159160                const CodeLocation & loc, const std::string & name, Storage::Classes storage,
    160161                const Type * b, Linkage::Spec spec = Linkage::Cforall )
    161         : Decl( loc, name, storage, spec ), base( b ), assertions() {}
     162        : Decl( loc, name, storage, spec ), base( b ), params(), assertions() {}
    162163
    163164        /// Produces a name for the kind of alias
  • src/AST/Pass.impl.hpp

    r3e3f236 r297cf18  
    609609        VISIT({
    610610                guard_symtab guard { *this };
     611                maybe_accept( node, &TypeDecl::params );
    611612                maybe_accept( node, &TypeDecl::base   );
    612613        })
     
    637638        VISIT({
    638639                guard_symtab guard { *this };
     640                maybe_accept( node, &TypedefDecl::params );
    639641                maybe_accept( node, &TypedefDecl::base   );
    640642        })
  • src/AST/Print.cpp

    r3e3f236 r297cf18  
    221221                        ++indent;
    222222                        node->base->accept( *this );
     223                        --indent;
     224                }
     225
     226                if ( ! node->params.empty() ) {
     227                        os << endl << indent << "... with parameters" << endl;
     228                        ++indent;
     229                        printAll( node->params );
    223230                        --indent;
    224231                }
  • src/Common/PassVisitor.impl.h

    r3e3f236 r297cf18  
    835835        {
    836836                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     837                maybeAccept_impl( node->parameters, *this );
    837838                maybeAccept_impl( node->base      , *this );
    838839        }
     
    857858        {
    858859                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     860                maybeAccept_impl( node->parameters, *this );
    859861                maybeAccept_impl( node->base      , *this );
    860862        }
     
    878880        {
    879881                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     882                maybeMutate_impl( node->parameters, *this );
    880883                maybeMutate_impl( node->base      , *this );
    881884        }
     
    901904        {
    902905                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     906                maybeAccept_impl( node->parameters, *this );
    903907                maybeAccept_impl( node->base      , *this );
    904908        }
     
    917921        {
    918922                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     923                maybeAccept_impl( node->parameters, *this );
    919924                maybeAccept_impl( node->base      , *this );
    920925        }
     
    933938        {
    934939                auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
     940                maybeMutate_impl( node->parameters, *this );
    935941                maybeMutate_impl( node->base      , *this );
    936942        }
  • src/Parser/TypeData.cc

    r3e3f236 r297cf18  
    900900                ret = new TypeDecl( name, scs, typebuild( td->base ), TypeDecl::Dtype, true );
    901901        } // if
     902        buildList( td->symbolic.params, ret->get_parameters() );
    902903        buildList( td->symbolic.assertions, ret->get_assertions() );
    903904        ret->base->attributes.splice( ret->base->attributes.end(), attributes );
  • src/SynTree/Declaration.h

    r3e3f236 r297cf18  
    181181  public:
    182182        Type * base;
     183        std::list< TypeDecl * > parameters;
    183184        std::list< DeclarationWithType * > assertions;
    184185
     
    189190        Type * get_base() const { return base; }
    190191        void set_base( Type * newValue ) { base = newValue; }
     192        std::list< TypeDecl* > & get_parameters() { return parameters; }
    191193        std::list< DeclarationWithType * >& get_assertions() { return assertions; }
    192194
  • src/SynTree/NamedTypeDecl.cc

    r3e3f236 r297cf18  
    2929NamedTypeDecl::NamedTypeDecl( const NamedTypeDecl &other )
    3030        : Parent( other ), base( maybeClone( other.base ) ) {
     31        cloneAll( other.parameters, parameters );
    3132        cloneAll( other.assertions, assertions );
    3233}
     
    3435NamedTypeDecl::~NamedTypeDecl() {
    3536        delete base;
     37        deleteAll( parameters );
    3638        deleteAll( assertions );
    3739}
     
    5456                base->print( os, indent+1 );
    5557        } // if
     58        if ( ! parameters.empty() ) {
     59                os << endl << indent << "... with parameters" << endl;
     60                printAll( parameters, os, indent+1 );
     61        } // if
    5662        if ( ! assertions.empty() ) {
    5763                os << endl << indent << "... with assertions" << endl;
     
    7076                base->print( os, indent+1 );
    7177        } // if
     78        if ( ! parameters.empty() ) {
     79                os << endl << indent << "... with parameters" << endl;
     80                printAll( parameters, os, indent+1 );
     81        } // if
    7282}
    7383
Note: See TracChangeset for help on using the changeset viewer.