Changeset fc12f05 for src/ResolvExpr/typeops.h
- Timestamp:
- Nov 13, 2023, 3:43:43 AM (23 months ago)
- Branches:
- master
- Children:
- 25f2798
- Parents:
- 0030b508 (diff), 2174191 (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
r0030b508 rfc12f05 19 19 20 20 #include "AST/Type.hpp" 21 #include "SynTree/Type.h"22 21 23 22 namespace SymTab { … … 52 51 std::copy( i.begin(), i.end(), inserter ); 53 52 *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 53 } 80 54 } … … 120 94 return tupleFromTypes( tys.begin(), tys.end() ); 121 95 } 122 123 // in TypeEnvironment.cc124 bool isFtype( const Type * type );125 96 } // namespace ResolvExpr 126 97
Note:
See TracChangeset
for help on using the changeset viewer.