- Timestamp:
- Apr 17, 2023, 11:00:38 AM (17 months ago)
- Branches:
- ADT, ast-experimental, master
- Children:
- 81bd7e3
- Parents:
- 6349929
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.h
r6349929 r66b6f66 179 179 // This generic buildList is here along side its overloads. 180 180 template<typename AstType, typename NodeType, 181 181 template<typename, typename...> class Container, typename... Args> 182 182 void buildList( NodeType * firstNode, 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 183 Container<ast::ptr<AstType>, Args...> & output ) { 184 SemanticErrorException errors; 185 std::back_insert_iterator<Container<ast::ptr<AstType>, Args...>> out( output ); 186 NodeType * cur = firstNode; 187 188 while ( cur ) { 189 try { 190 if ( auto result = dynamic_cast<AstType *>( maybeBuild( cur ) ) ) { 191 *out++ = result; 192 } else { 193 assertf(false, __PRETTY_FUNCTION__ ); 194 SemanticError( cur->location, "type specifier declaration in forall clause is currently unimplemented." ); 195 } // if 196 } catch( SemanticErrorException & e ) { 197 errors.append( e ); 198 } // try 199 ParseNode * temp = cur->get_next(); 200 // Should not return nullptr, then it is non-homogeneous: 201 cur = dynamic_cast<NodeType *>( temp ); 202 if ( !cur && temp ) { 203 SemanticError( temp->location, "internal error, non-homogeneous nodes founds in buildList processing." ); 204 } // if 205 } // while 206 if ( ! errors.isEmpty() ) { 207 throw errors; 208 } // if 209 209 } 210 210 … … 214 214 215 215 template<typename AstType, typename NodeType, 216 template<typename, typename...> class Container, typename... Args>216 template<typename, typename...> class Container, typename... Args> 217 217 void buildMoveList( NodeType * firstNode, 218 218 Container<ast::ptr<AstType>, Args...> & output ) {
Note: See TracChangeset
for help on using the changeset viewer.