- Timestamp:
- Oct 9, 2024, 5:07:59 PM (5 weeks ago)
- Branches:
- master
- Children:
- 0766399
- Parents:
- 1b770e40
- Location:
- src
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Node.hpp
r1b770e40 r16ba4897 161 161 } 162 162 } 163 if ( ! errors.isEmpty() ) { 164 throw errors; 165 } 163 errors.throwIfNonEmpty(); 166 164 } 167 165 -
src/AST/Pass.impl.hpp
r1b770e40 r16ba4897 250 250 } 251 251 pass_visitor_stats.depth--; 252 if ( !errors.isEmpty() ) { throw errors; }252 errors.throwIfNonEmpty(); 253 253 254 254 return new_kids; … … 287 287 __pedantic_pass_assert( new_kids.size() == container.size() ); 288 288 pass_visitor_stats.depth--; 289 if ( !errors.isEmpty() ) { throw errors; }289 errors.throwIfNonEmpty(); 290 290 291 291 return ast::__pass::resultN<container_t, node_t>{ mutated, new_kids }; … … 401 401 } 402 402 pass_visitor_stats.depth--; 403 if ( !errors.isEmpty() ) { throw errors; }403 errors.throwIfNonEmpty(); 404 404 } 405 405 -
src/Common/ErrorObjects.hpp
r1b770e40 r16ba4897 41 41 void append( SemanticErrorException & other ); 42 42 void append( CodeLocation location, const std::string & ); 43 bool isEmpty() const;43 void throwIfNonEmpty(); 44 44 void print(); 45 45 private: -
src/Common/SemanticError.cpp
r1b770e40 r16ba4897 88 88 } 89 89 90 bool SemanticErrorException::isEmpty() const { 91 return errors.empty(); 90 void SemanticErrorException::throwIfNonEmpty() { 91 if ( !errors.empty() ) { 92 throw *this; 93 } 92 94 } 93 95 -
src/ControlStruct/MultiLevelExit.cpp
r1b770e40 r16ba4897 688 688 } 689 689 690 if ( !errors.isEmpty() ) { 691 throw errors; 692 } 690 errors.throwIfNonEmpty(); 693 691 return ret; 694 692 } -
src/InitTweak/FixInit.cpp
r1b770e40 r16ba4897 301 301 } // try 302 302 } // for 303 if ( ! errors.isEmpty() ) { 304 throw errors; 305 } // if 303 errors.throwIfNonEmpty(); 306 304 } 307 305 … … 1173 1171 function->stmts = mutStmts; 1174 1172 } 1175 if (! errors.isEmpty()) { 1176 throw errors; 1177 } 1173 errors.throwIfNonEmpty(); 1178 1174 return function; 1179 1175 } -
src/Parser/DeclarationNode.cpp
r1b770e40 r16ba4897 829 829 } // for 830 830 831 if ( ! errors.isEmpty() ) { 832 throw errors; 833 } // if 831 errors.throwIfNonEmpty(); 834 832 } // buildList 835 833 … … 879 877 } // for 880 878 881 if ( ! errors.isEmpty() ) { 882 throw errors; 883 } // if 879 errors.throwIfNonEmpty(); 884 880 } // buildList 885 881 … … 897 893 } // for 898 894 899 if ( ! errors.isEmpty() ) { 900 throw errors; 901 } // if 895 errors.throwIfNonEmpty(); 902 896 } // buildTypeList 903 897 -
src/Parser/DeclarationNode.hpp
r1b770e40 r16ba4897 156 156 } // try 157 157 } // for 158 if ( ! errors.isEmpty() ) { 159 throw errors; 160 } // if 158 errors.throwIfNonEmpty(); 161 159 } 162 160 -
src/ResolvExpr/CandidateFinder.cpp
r1b770e40 r16ba4897 1115 1115 // Implement SFINAE; resolution errors are only errors if there aren't any non-error 1116 1116 // candidates 1117 if ( found.empty() && ! errors.isEmpty() ) { throw errors; }1117 if ( found.empty() ) errors.throwIfNonEmpty(); 1118 1118 1119 1119 // only keep the best matching intrinsic result to match C semantics (no unexpected narrowing/widening) -
src/Validate/CheckAssertions.cpp
r1b770e40 r16ba4897 60 60 makeTypeVarMap( decl, typeVars ); 61 61 checkList( typeVars, errors, decl->assertions ); 62 if ( !errors.isEmpty() ) { throw errors; }62 errors.throwIfNonEmpty(); 63 63 } 64 64 … … 72 72 } 73 73 if ( checkMembers ) checkList( typeVars, errors, decl->members ); 74 if ( !errors.isEmpty() ) { throw errors; }74 errors.throwIfNonEmpty(); 75 75 } 76 76 -
src/Validate/ReplaceTypedef.cpp
r1b770e40 r16ba4897 327 327 assert( declsToAddBefore.empty() ); 328 328 assert( declsToAddAfter.empty() ); 329 if ( !errors.isEmpty() ) { throw errors; }329 errors.throwIfNonEmpty(); 330 330 331 331 mut->members.clear();
Note: See TracChangeset
for help on using the changeset viewer.