- Timestamp:
- Jun 16, 2023, 9:10:46 AM (2 years ago)
- Branches:
- master
- Children:
- 5dbb9f3
- Parents:
- a0bd9a2 (diff), 62d62db (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src/AST
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
ra0bd9a2 re172f42 2343 2343 old->location, 2344 2344 GET_ACCEPT_1(arg, Expr), 2345 old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast 2345 old->isGenerated ? ast::GeneratedCast : ast::ExplicitCast, 2346 (ast::CastExpr::CastKind) old->kind 2346 2347 ) 2347 2348 ); -
src/AST/Expr.cpp
ra0bd9a2 re172f42 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
ra0bd9a2 re172f42 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 … … 335 337 GeneratedFlag isGenerated; 336 338 339 enum CastKind { 340 Default, // C 341 Coerce, // reinterpret cast 342 Return // overload selection 343 }; 344 345 CastKind kind = Default; 346 337 347 CastExpr( const CodeLocation & loc, const Expr * a, const Type * to, 338 GeneratedFlag g = GeneratedCast ) : Expr( loc, to ), arg( a ), isGenerated( g) {}348 GeneratedFlag g = GeneratedCast, CastKind kind = Default ) : Expr( loc, to ), arg( a ), isGenerated( g ), kind( kind ) {} 339 349 /// Cast-to-void 340 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast );350 CastExpr( const CodeLocation & loc, const Expr * a, GeneratedFlag g = GeneratedCast, CastKind kind = Default ); 341 351 342 352 /// Wrap a cast expression around an existing expression (always generated) -
src/AST/SymbolTable.cpp
ra0bd9a2 re172f42 19 19 20 20 #include "Copy.hpp" 21 #include <iostream> 22 #include <algorithm> 23 21 24 #include "Decl.hpp" 22 25 #include "Expr.hpp" … … 203 206 out.push_back(decl.second); 204 207 } 208 209 // std::cerr << otypeKey << ' ' << out.size() << std::endl; 205 210 } 206 211 -
src/AST/Type.hpp
ra0bd9a2 re172f42 451 451 bool operator==(const TypeEnvKey & other) const; 452 452 bool operator<(const TypeEnvKey & other) const; 453 }; 453 operator bool() {return base;} 454 }; 455 454 456 455 457 /// tuple type e.g. `[int, char]` -
src/AST/TypeEnvironment.cpp
ra0bd9a2 re172f42 135 135 } 136 136 } 137 sub.normalize();137 // sub.normalize(); 138 138 } 139 139 -
src/AST/TypeEnvironment.hpp
ra0bd9a2 re172f42 63 63 64 64 int cmp = d1->var->name.compare( d2->var->name ); 65 return cmp <0 || ( cmp == 0 && d1->result < d2->result );65 return cmp > 0 || ( cmp == 0 && d1->result < d2->result ); 66 66 } 67 67 };
Note:
See TracChangeset
for help on using the changeset viewer.