Ignore:
Timestamp:
Jan 17, 2023, 11:57:46 AM (16 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
7b5694d
Parents:
9845cb6
Message:

Header Clean-up: Clearing out typeops, moving things to Unify because that header already exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r9845cb6 re563edf  
    5050
    5151namespace SymTab {
    52 class Indexer;
     52        class Indexer;
    5353}  // namespace SymTab
    5454
     
    5656
    5757namespace ResolvExpr {
     58
     59// Template Helpers:
     60template< typename Iterator1, typename Iterator2 >
     61bool 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
     72template< typename Iterator1, typename Iterator2 >
     73bool 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}
    5882
    5983        struct Unify_old : public WithShortCircuiting {
Note: See TracChangeset for help on using the changeset viewer.