Changes in / [28c89f4:ed5e798]
- Location:
- src/AST
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r28c89f4 red5e798 948 948 get<Type>().accept1( node->base ), 949 949 get<Expression>().accept1( node->dimension ), 950 node->isVarLen,951 node->isStatic950 (bool)node->isVarLen, 951 (bool)node->isStatic 952 952 }; 953 953 return nullptr; … … 959 959 get<Type>().accept1( node->base ), 960 960 get<Expression>().accept1( node->dimension ), 961 node->isVarLen,962 node->isStatic961 (bool)node->isVarLen, 962 (bool)node->isStatic 963 963 }; 964 964 return nullptr; … … 983 983 984 984 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 }; 986 989 ty->returnVals = get<DeclarationWithType>().acceptL( node->returns ); 987 990 ty->parameters = get<DeclarationWithType>().acceptL( node->params ); … … 1100 1103 1101 1104 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 }; 1103 1110 return nullptr; 1104 1111 } 1105 1112 1106 1113 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 }; 1108 1119 return nullptr; 1109 1120 } 1110 1121 1111 1122 const ast::Type * visit( const ast::VarArgsType * node ) override final { 1112 (void)node;1123 this->node = new VarArgsType{ cv( node ) }; 1113 1124 return nullptr; 1114 1125 } 1115 1126 1116 1127 const ast::Type * visit( const ast::ZeroType * node ) override final { 1117 (void)node;1128 this->node = new ZeroType{ cv( node ) }; 1118 1129 return nullptr; 1119 1130 } 1120 1131 1121 1132 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{}; 1128 1139 return nullptr; 1129 1140 } … … 2215 2226 } 2216 2227 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 }; 2223 2242 } 2224 2243 2225 2244 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 ) }; 2239 2258 } 2240 2259 2241 2260 virtual void visit( GlobalScopeType * ) override final { 2242 2261 this->node = new ast::GlobalScopeType{}; 2243 2262 } 2244 2263 -
src/AST/Type.hpp
r28c89f4 red5e798 514 514 class GlobalScopeType final : public Type { 515 515 public: 516 GlobalScopeType( CV::Qualifiers q = {} ) : Type( q) {}516 GlobalScopeType() : Type() {} 517 517 518 518 const Type * accept( Visitor & v ) const override { return v.visit( this ); }
Note: See TracChangeset
for help on using the changeset viewer.