- Timestamp:
- May 2, 2023, 3:44:31 AM (2 years ago)
- Branches:
- ast-experimental, master
- Children:
- 0c840fc
- Parents:
- 1ab773e0
- Location:
- src/AST
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
r1ab773e0 r46da46b 2331 2331 old->location, 2332 2332 GET_ACCEPT_1(arg, Expr), 2333 old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast 2333 old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast, 2334 (ast::CastExpr::CastKind) old->kind 2334 2335 ) 2335 2336 ); -
src/AST/Expr.cpp
r1ab773e0 r46da46b 186 186 // --- CastExpr 187 187 188 CastExpr::CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g )189 : Expr( loc, new VoidType{} ), arg( a ), isGenerated( g ) {}188 CastExpr::CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g, CastKind kind ) 189 : Expr( loc, new VoidType{} ), arg( a ), isGenerated( g ), kind( kind ) {} 190 190 191 191 bool CastExpr::get_lvalue() const { -
src/AST/Expr.hpp
r1ab773e0 r46da46b 55 55 const Expr * e ) 56 56 : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {} 57 58 operator bool() {return declptr;} 57 59 }; 58 60 … … 334 336 GeneratedFlag isGenerated; 335 337 338 enum CastKind { 339 Default, // C 340 Coerce, // reinterpret cast 341 Return // overload selection 342 }; 343 344 CastKind kind = Default; 345 336 346 CastExpr( const CodeLocation & loc, const Expr * a, const Type * to, 337 GeneratedFlag g = GeneratedCast ) : Expr( loc, to ), arg( a ), isGenerated( g) {}347 GeneratedFlag g = GeneratedCast, CastKind kind = Default ) : Expr( loc, to ), arg( a ), isGenerated( g ), kind( kind ) {} 338 348 /// Cast-to-void 339 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast );349 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast, CastKind kind = Default ); 340 350 341 351 /// Wrap a cast expression around an existing expression (always generated) -
src/AST/Type.hpp
r1ab773e0 r46da46b 454 454 bool operator==(const TypeEnvKey & other) const; 455 455 bool operator<(const TypeEnvKey & other) const; 456 }; 456 operator bool() {return base;} 457 }; 458 457 459 458 460 /// tuple type e.g. `[int, char]` -
src/AST/TypeEnvironment.cpp
r1ab773e0 r46da46b 135 135 } 136 136 } 137 sub.normalize();137 // sub.normalize(); 138 138 } 139 139
Note:
See TracChangeset
for help on using the changeset viewer.