Changeset e563edf for src/ResolvExpr/Unify.cc
- Timestamp:
- Jan 17, 2023, 11:57:46 AM (16 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 7b5694d
- Parents:
- 9845cb6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Unify.cc
r9845cb6 re563edf 50 50 51 51 namespace SymTab { 52 class Indexer;52 class Indexer; 53 53 } // namespace SymTab 54 54 … … 56 56 57 57 namespace ResolvExpr { 58 59 // Template Helpers: 60 template< typename Iterator1, typename Iterator2 > 61 bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, std::list< Type* > &commonTypes ) { 62 for ( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) { 63 Type *commonType = 0; 64 if ( ! unify( *list1Begin, *list2Begin, env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) { 65 return false; 66 } // if 67 commonTypes.push_back( commonType ); 68 } // for 69 return ( list1Begin == list1End && list2Begin == list2End ); 70 } 71 72 template< typename Iterator1, typename Iterator2 > 73 bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) { 74 std::list< Type* > commonTypes; 75 if ( unifyList( list1Begin, list1End, list2Begin, list2End, env, needAssertions, haveAssertions, openVars, indexer, commonTypes ) ) { 76 deleteAll( commonTypes ); 77 return true; 78 } else { 79 return false; 80 } // if 81 } 58 82 59 83 struct Unify_old : public WithShortCircuiting {
Note: See TracChangeset
for help on using the changeset viewer.