Changeset fac05b3 for src/ResolvExpr
- Timestamp:
- Apr 6, 2023, 4:09:24 PM (17 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 485393c
- Parents:
- c468150
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CurrentObject.cc
rc468150 rfac05b3 10 10 // Created On : Tue Jun 13 15:28:32 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jul 1 09:16:01 202213 // Update Count : 1 512 // Last Modified On : Thu Apr 6 16:03:00 2023 13 // Update Count : 16 14 14 // 15 15 … … 899 899 900 900 class TupleIterator final : public AggregateIterator { 901 MemberList * memberList; 902 903 TupleIterator( const CodeLocation & loc, 904 const ast::TupleType * inst, MemberList * memberList ) 905 : AggregateIterator( 906 loc, "TupleIterator", toString("Tuple", inst->size()), inst, *memberList 907 ), memberList( memberList ) {} 908 909 // The two layer constructor, this helper and the destructor 910 // are all to pretend that Tuples have members (they do not). 911 static MemberList * newImaginaryMembers( const ast::TupleType * inst ) { 912 auto ret = new MemberList(); 913 ret->reserve( inst->types.size() ); 914 for ( const ast::Type * type : inst->types ) { 915 ret->emplace_back( new ast::ObjectDecl( 916 CodeLocation(), "", type, 917 new ast::ListInit( CodeLocation(), {}, {}, ast::NoConstruct ) 918 ) ); 919 } 920 return ret; 921 } 922 901 923 public: 902 924 TupleIterator( const CodeLocation & loc, const TupleType * inst ) 903 : AggregateIterator( 904 loc, "TupleIterator", toString("Tuple", inst->size()), inst, inst->members 905 ) {} 925 : TupleIterator( loc, inst, newImaginaryMembers( inst ) ) {} 926 927 virtual ~TupleIterator() { 928 delete memberList; 929 } 906 930 907 931 operator bool() const override {
Note: See TracChangeset
for help on using the changeset viewer.