Skip to content

Commit c2c0a64

Browse files
committed
reformat some error message code, add one message for complex insts
1 parent 674fa94 commit c2c0a64

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

src/clstepcore/STEPcomplex.cc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -303,37 +303,37 @@ Severity STEPcomplex::STEPread( int id, int addFileId, class InstMgrBase * insta
303303
in >> ws;
304304
c = in.peek();
305305
if( c != '(' ) {
306-
_error.AppendToDetailMsg(
307-
"Missing open paren before entity attr values.\n" );
306+
_error.AppendToDetailMsg( "Missing open paren before entity attr values.\n" );
308307
cout << "ERROR: missing open paren\n";
309308
_error.GreaterSeverity( SEVERITY_INPUT_ERROR );
310309
STEPread_error( c, 0, in, currSch );
311310
return _error.severity();
312311
}
313312

314313
stepc = EntityPart( typeNm.c_str(), currSch );
315-
if( stepc )
316-
stepc->SDAI_Application_instance::STEPread( id, addFileId,
317-
instance_set, in,
318-
currSch );
319-
else {
320-
cout << "ERROR: complex entity part \"" << typeNm
321-
<< "\" does not exist.\n";
322-
_error.AppendToDetailMsg(
323-
"Complex entity part of instance does not exist.\n" );
314+
if( stepc ) {
315+
//WARNING need to seek to the correct position when this is done... how?
316+
stepc->SDAI_Application_instance::STEPread( id, addFileId, instance_set, in, currSch );
317+
} else {
318+
cout << "ERROR: complex entity part \"" << typeNm << "\" does not exist." << endl;;
319+
_error.AppendToDetailMsg( "Complex entity part of instance does not exist.\n" );
324320
_error.GreaterSeverity( SEVERITY_INPUT_ERROR );
325321
STEPread_error( c, 0, in, currSch );
326322
return _error.severity();
327323
}
328324
in >> ws;
329325
c = in.peek();
330326
}
331-
if( c != ')' )
332-
cout <<
333-
"ERROR: missing ending paren for complex entity instance.\n";
334-
else {
327+
if( c != ')' ) {
328+
cout << "ERROR: missing ending paren for complex entity instance." << endl;
329+
} else {
335330
in.get( c ); // read the closing paren
336331
}
332+
} else {
333+
_error.AppendToDetailMsg( "Complex instances must begin with '('. Found '" );
334+
_error.AppendToDetailMsg( c );
335+
_error.AppendToDetailMsg( "' instead.\n" );
336+
_error.GreaterSeverity( SEVERITY_INPUT_ERROR );
337337
}
338338
return _error.severity();
339339
}

src/clstepcore/sdaiApplication_instance.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,7 @@ SDAI_Application_instance * ReadEntityRef( istream & in, ErrorDescriptor * err,
640640
in >> c;
641641
switch( c ) {
642642
case '@':
643-
err->AppendToDetailMsg(
644-
"Use of @ instead of # to identify entity.\n" );
643+
err->AppendToDetailMsg( "Use of @ instead of # to identify entity.\n" );
645644
err->GreaterSeverity( SEVERITY_WARNING );
646645
// no break statement here on purpose
647646
case '#': {

0 commit comments

Comments
 (0)