@@ -176,10 +176,8 @@ Parser::~Parser()
176176/* Parse the file. */
177177void Parser::Run ()
178178{
179- int error_line = -1 ;
180- int error_col = -1 ;
181- UCS2String error_filename (POV_FILENAME_BUFFER_CHARS, 0 ); // Pre-claim some memory, so we can handle an out-of-memory error.
182- POV_OFF_T error_pos = -1 ;
179+ SourceInfo errorInfo (UCS2String (POV_FILENAME_BUFFER_CHARS, 0 ), // Pre-claim some memory, so we can handle an out-of-memory error.
180+ SourcePosition (-1 ,-1 ,-1 ));
183181
184182 // Outer try/catch block to handle out-of-memory conditions
185183 // occurring during regular error handling.
@@ -301,10 +299,8 @@ void Parser::Run()
301299 {
302300 // take a (local) copy of error location prior to freeing token data
303301 // NB error_filename has been pre-allocated for strings up to POV_FILENAME_BUFFER_CHARS
304- error_filename = CurrentFileName ();
305- error_line = CurrentFilePosition ().line ;
306- error_col = CurrentFilePosition ().column ;
307- error_pos = CurrentFilePosition ().offset ;
302+ errorInfo.fileName = CurrentFileName ();
303+ errorInfo.position = CurrentFilePosition ();
308304 }
309305
310306 // free up some memory before proceeding with error notification.
@@ -313,8 +309,8 @@ void Parser::Run()
313309 Default_Texture = nullptr ;
314310 Destroy_Random_Generators ();
315311
316- if (error_line != -1 )
317- mMessageFactory .ErrorAt (POV_EXCEPTION_CODE (kOutOfMemoryErr ), error_filename, error_line, error_col, error_pos , " Out of memory." );
312+ if (errorInfo. position . line != -1 )
313+ mMessageFactory .ErrorAt (POV_EXCEPTION_CODE (kOutOfMemoryErr ), errorInfo , " Out of memory." );
318314 else
319315 Error (" Out of memory." );
320316 }
0 commit comments