Changes in / [ed5e798:28c89f4]
- Location:
- src/AST
- Files:
-
- 2 edited
-
Convert.cpp (modified) (5 diffs)
-
Type.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
red5e798 r28c89f4 948 948 get<Type>().accept1( node->base ), 949 949 get<Expression>().accept1( node->dimension ), 950 (bool)node->isVarLen,951 (bool)node->isStatic950 node->isVarLen, 951 node->isStatic 952 952 }; 953 953 return nullptr; … … 959 959 get<Type>().accept1( node->base ), 960 960 get<Expression>().accept1( node->dimension ), 961 (bool)node->isVarLen,962 (bool)node->isStatic961 node->isVarLen, 962 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 { 986 cv( node ), 987 (bool)node->isVarArgs 988 }; 985 auto ty = new FunctionType { cv( node ), node->isVarArgs }; 989 986 ty->returnVals = get<DeclarationWithType>().acceptL( node->returns ); 990 987 ty->parameters = get<DeclarationWithType>().acceptL( node->params ); … … 1103 1100 1104 1101 const ast::Type * visit( const ast::TupleType * node ) override final { 1105 this->node = new TupleType{ 1106 cv( node ), 1107 get<Type>().acceptL( node->types ) 1108 // members generated by TupleType c'tor 1109 }; 1102 (void)node; 1110 1103 return nullptr; 1111 1104 } 1112 1105 1113 1106 const ast::Type * visit( const ast::TypeofType * node ) override final { 1114 this->node = new TypeofType{ 1115 cv( node ), 1116 get<Expression>().accept1( node->expr ), 1117 (bool)node->kind 1118 }; 1107 (void)node; 1119 1108 return nullptr; 1120 1109 } 1121 1110 1122 1111 const ast::Type * visit( const ast::VarArgsType * node ) override final { 1123 this->node = new VarArgsType{ cv( node ) };1112 (void)node; 1124 1113 return nullptr; 1125 1114 } 1126 1115 1127 1116 const ast::Type * visit( const ast::ZeroType * node ) override final { 1128 this->node = new ZeroType{ cv( node ) };1117 (void)node; 1129 1118 return nullptr; 1130 1119 } 1131 1120 1132 1121 const ast::Type * visit( const ast::OneType * node ) override final { 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{};1122 (void)node; 1123 return nullptr; 1124 } 1125 1126 const ast::Type * visit( const ast::GlobalScopeType * node ) override final { 1127 (void)node; 1139 1128 return nullptr; 1140 1129 } … … 2226 2215 } 2227 2216 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 }; 2217 virtual void visit( TupleType * ) override final { 2218 2219 } 2220 2221 virtual void visit( TypeofType * ) override final { 2222 2242 2223 } 2243 2224 2244 2225 virtual void visit( AttrType * ) override final { 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 ) }; 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 2258 2239 } 2259 2240 2260 2241 virtual void visit( GlobalScopeType * ) override final { 2261 this->node = new ast::GlobalScopeType{}; 2242 2262 2243 } 2263 2244 -
src/AST/Type.hpp
red5e798 r28c89f4 514 514 class GlobalScopeType final : public Type { 515 515 public: 516 GlobalScopeType( ) : Type() {}516 GlobalScopeType( CV::Qualifiers q = {} ) : Type( q ) {} 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.