Changeset 8d182b1 for src/ResolvExpr/typeops.h
- Timestamp:
- Nov 14, 2023, 12:19:09 PM (23 months ago)
- Branches:
- master
- Children:
- 1ccae59, 89a8bab
- Parents:
- df8ba61a (diff), 5625427 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/typeops.h
rdf8ba61a r8d182b1 19 19 20 20 #include "AST/Type.hpp" 21 #include "SynTree/Type.h"22 23 namespace SymTab {24 class Indexer;25 }26 21 27 22 namespace ResolvExpr { … … 52 47 std::copy( i.begin(), i.end(), inserter ); 53 48 *out++ = result; 54 }55 }56 57 // in Occurs.cc58 bool occurs( const Type * type, const std::string & varName, const TypeEnvironment & env );59 // new AST version in TypeEnvironment.cpp (only place it was used in old AST)60 61 template<typename Iter>62 bool occursIn( Type* ty, Iter begin, Iter end, const TypeEnvironment & env ) {63 while ( begin != end ) {64 if ( occurs( ty, *begin, env ) ) return true;65 ++begin;66 }67 return false;68 }69 70 /// flatten tuple type into list of types71 template< typename OutputIterator >72 void flatten( Type * type, OutputIterator out ) {73 if ( TupleType * tupleType = dynamic_cast< TupleType * >( type ) ) {74 for ( Type * t : tupleType->get_types() ) {75 flatten( t, out );76 }77 } else {78 *out++ = type->clone();79 49 } 80 50 } … … 120 90 return tupleFromTypes( tys.begin(), tys.end() ); 121 91 } 122 123 // in TypeEnvironment.cc124 bool isFtype( const Type * type );125 92 } // namespace ResolvExpr 126 93
Note:
See TracChangeset
for help on using the changeset viewer.