Changes in / [28c89f4:ed5e798]


Ignore:
Location:
src/AST
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r28c89f4 red5e798  
    948948                        get<Type>().accept1( node->base ),
    949949                        get<Expression>().accept1( node->dimension ),
    950                         node->isVarLen,
    951                         node->isStatic
     950                        (bool)node->isVarLen,
     951                        (bool)node->isStatic
    952952                };
    953953                return nullptr;
     
    959959                        get<Type>().accept1( node->base ),
    960960                        get<Expression>().accept1( node->dimension ),
    961                         node->isVarLen,
    962                         node->isStatic
     961                        (bool)node->isVarLen,
     962                        (bool)node->isStatic
    963963                };
    964964                return nullptr;
     
    983983
    984984        const ast::Type * visit( const ast::FunctionType * node ) override final {
    985                 auto ty = new FunctionType { cv( node ), node->isVarArgs };
     985                auto ty = new FunctionType {
     986                        cv( node ),
     987                        (bool)node->isVarArgs
     988                };
    986989                ty->returnVals = get<DeclarationWithType>().acceptL( node->returns );
    987990                ty->parameters = get<DeclarationWithType>().acceptL( node->params );
     
    11001103
    11011104        const ast::Type * visit( const ast::TupleType * node ) override final {
    1102                 (void)node;
     1105                this->node = new TupleType{
     1106                        cv( node ),
     1107                        get<Type>().acceptL( node->types )
     1108                        // members generated by TupleType c'tor
     1109                };
    11031110                return nullptr;
    11041111        }
    11051112
    11061113        const ast::Type * visit( const ast::TypeofType * node ) override final {
    1107                 (void)node;
     1114                this->node = new TypeofType{
     1115                        cv( node ),
     1116                        get<Expression>().accept1( node->expr ),
     1117                        (bool)node->kind
     1118                };
    11081119                return nullptr;
    11091120        }
    11101121
    11111122        const ast::Type * visit( const ast::VarArgsType * node ) override final {
    1112                 (void)node;
     1123                this->node = new VarArgsType{ cv( node ) };
    11131124                return nullptr;
    11141125        }
    11151126
    11161127        const ast::Type * visit( const ast::ZeroType * node ) override final {
    1117                 (void)node;
     1128                this->node = new ZeroType{ cv( node ) };
    11181129                return nullptr;
    11191130        }
    11201131
    11211132        const ast::Type * visit( const ast::OneType * node ) override final {
    1122                 (void)node;
    1123                 return nullptr;
    1124         }
    1125 
    1126         const ast::Type * visit( const ast::GlobalScopeType * node ) override final {
    1127                 (void)node;
     1133                this->node = new OneType{ cv( node ) };
     1134                return nullptr;
     1135        }
     1136
     1137        const ast::Type * visit( const ast::GlobalScopeType * ) override final {
     1138                this->node = new GlobalScopeType{};
    11281139                return nullptr;
    11291140        }
     
    22152226        }
    22162227
    2217         virtual void visit( TupleType * ) override final {
    2218 
    2219         }
    2220 
    2221         virtual void visit( TypeofType * ) override final {
    2222 
     2228        virtual void visit( TupleType * old ) override final {
     2229                this->node = new ast::TupleType{
     2230                        GET_ACCEPT_V( types, Type ),
     2231                        // members generated by TupleType c'tor
     2232                        cv( old )
     2233                };
     2234        }
     2235
     2236        virtual void visit( TypeofType * old ) override final {
     2237                this->node = new ast::TypeofType{
     2238                        GET_ACCEPT_1( expr, Expr ),
     2239                        (ast::TypeofType::Kind)old->is_basetypeof,
     2240                        cv( old )
     2241                };
    22232242        }
    22242243
    22252244        virtual void visit( AttrType * ) override final {
    2226 
    2227         }
    2228 
    2229         virtual void visit( VarArgsType * ) override final {
    2230 
    2231         }
    2232 
    2233         virtual void visit( ZeroType * ) override final {
    2234 
    2235         }
    2236 
    2237         virtual void visit( OneType * ) override final {
    2238 
     2245                assertf( false, "AttrType deprecated in new AST." );
     2246        }
     2247
     2248        virtual void visit( VarArgsType * old ) override final {
     2249                this->node = new ast::VarArgsType{ cv( old ) };
     2250        }
     2251
     2252        virtual void visit( ZeroType * old ) override final {
     2253                this->node = new ast::ZeroType{ cv( old ) };
     2254        }
     2255
     2256        virtual void visit( OneType * old ) override final {
     2257                this->node = new ast::OneType{ cv( old ) };
    22392258        }
    22402259
    22412260        virtual void visit( GlobalScopeType * ) override final {
    2242 
     2261                this->node = new ast::GlobalScopeType{};
    22432262        }
    22442263
  • src/AST/Type.hpp

    r28c89f4 red5e798  
    514514class GlobalScopeType final : public Type {
    515515public:
    516         GlobalScopeType( CV::Qualifiers q = {} ) : Type( q ) {}
     516        GlobalScopeType() : Type() {}
    517517
    518518        const Type * accept( Visitor & v ) const override { return v.visit( this ); }
Note: See TracChangeset for help on using the changeset viewer.