Changeset ca9d65e for src/ControlStruct
- Timestamp:
- Dec 14, 2023, 9:05:55 PM (22 months ago)
- Branches:
- master
- Children:
- 19a2890
- Parents:
- 21ad568
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/MultiLevelExit.cpp
r21ad568 rca9d65e 10 10 // Created On : Mon Nov 1 13:48:00 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 11 13:44:45202313 // Update Count : 3 812 // Last Modified On : Thu Dec 14 17:34:12 2023 13 // Update Count : 39 14 14 // 15 15 … … 254 254 if ( enclosing_control_structures.empty() ) { 255 255 SemanticError( stmt->location, 256 " 'break' outside a loop, 'switch', or labelled block" );256 "\"break\" outside a loop, \"switch\", or labelled block" ); 257 257 } 258 258 targetEntry = findEnclosingControlStructure( isBreakTarget ); … … 268 268 // Ensure that selected target is valid. 269 269 if ( targetEntry == enclosing_control_structures.rend() || ( isContinue && ! isContinueTarget( *targetEntry ) ) ) { 270 SemanticError( stmt->location, toString( (isContinue ? " 'continue'" : "'break'"),270 SemanticError( stmt->location, toString( (isContinue ? "\"continue\"" : "\"break\""), 271 271 " target must be an enclosing ", (isContinue ? "loop: " : "control structure: "), 272 272 stmt->originalTarget ) ); … … 279 279 // Check that target is valid. 280 280 if ( targetEntry == enclosing_control_structures.rend() ) { 281 SemanticError( stmt->location, " 'fallthrough' must be enclosed in a 'switch' or 'choose'" );281 SemanticError( stmt->location, "\"fallthrough\" must be enclosed in a \"switch\" or \"choose\"" ); 282 282 } 283 283 if ( ! stmt->target.empty() ) { 284 284 // Labelled fallthrough: target must be a valid fallthough label. 285 285 if ( ! fallthrough_labels.count( stmt->target ) ) { 286 SemanticError( stmt->location, toString( " 'fallthrough'target must be a later case statement: ",286 SemanticError( stmt->location, toString( "\"fallthrough\" target must be a later case statement: ", 287 287 stmt->originalTarget ) ); 288 288 } … … 296 296 // Check if in switch or choose statement. 297 297 if ( targetEntry == enclosing_control_structures.rend() ) { 298 SemanticError( stmt->location, " 'fallthrough' must be enclosed in a 'switch' or 'choose'" );298 SemanticError( stmt->location, "\"fallthrough\" must be enclosed in a \"switch\" or \"choose\"" ); 299 299 } 300 300 … … 309 309 } 310 310 if ( ! foundDefault ) { 311 SemanticError( stmt->location, " 'fallthrough default' must be enclosed in a 'switch' or 'choose'"312 "control structure with a 'default'clause" );311 SemanticError( stmt->location, "\"fallthrough default\" must be enclosed in a \"switch\" or \"choose\"" 312 "control structure with a \"default\" clause" ); 313 313 } 314 314 break; … … 338 338 // Check that fallthrough default comes before the default clause. 339 339 if ( ! targetEntry->isFallDefaultValid() ) { 340 SemanticError( stmt->location, " 'fallthrough default' must precede the 'default'clause" );340 SemanticError( stmt->location, "\"fallthrough default\" must precede the \"default\" clause" ); 341 341 } 342 342 break; … … 521 521 assert(0); 522 522 } 523 SemanticError( stmt->location, " 'return'may not appear in a %s", context );523 SemanticError( stmt->location, "\"return\" may not appear in a %s", context ); 524 524 } 525 525
Note:
See TracChangeset
for help on using the changeset viewer.