diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a9f42c44f7..652ae0d37f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,6 +1,12 @@ +2000-06-14 22:37 UTC-0800 Ron Pinkas + * source/pp/ppcomp.c + ! Fixed missing CR at EOF of #include file, causing #line directive to be on same line with the next line in parrent file. + ! Big Improvment of line numbering of #line directive - almost identical to Clipper - to be continued. + 2000-06-14-22:10 GMT -3 Luiz Rafael Culik +doc/en/eval.txt *Documentation for Eval() function + 2000-06-14 23:37 UTC+0200 JfL&RaC * source/vm/classes.c ! Temporary Fixed hb___msgsuper() to refer the good self value when accessing super @@ -10,12 +16,10 @@ keeping compatibility with the old method (this is work in progress) 2000-06-14 15:30 UTC-0400 David G. Holm - * source/rtl/gtwin/gtwin.c ! Removed debug printf() statements. 2000-06-14 10:00 UTC-0800 Ron Pinkas - * source/pp/ppcore.c ! Fixed getExpReal() to terminate on unbalanced ')' @@ -31,6 +35,7 @@ *updated __dblist() and __dbupdate() entries *source/rdd/dblist.prg +Source file for __dbList() and __dbUpdate functions + 2000-06-13 22:47 UTC+0200 JfL&RaC * Classes.c * Initialisation is now properly working @@ -38,9 +43,7 @@ * MakeFile.bc * Restoring tasm call in place of tasm32 (sorry :-((( ) - 2000-06-13 19:55 UTC+0100 Ryszard Glab - *include/hbapigt.h *added declaration of hb_gt_Suspend()/hb_gt_Resume() @@ -55,7 +58,6 @@ *added full support for suspend/resume terminal settings 2000-06-13 08:08 UTC-0800 Ron Pinkas - * source/pp/ppcomp.c ! Minor correction - There should be no empty lines between #line directive any more. diff --git a/harbour/source/pp/ppcomp.c b/harbour/source/pp/ppcomp.c index 195db5b7e7..039a52b075 100644 --- a/harbour/source/pp/ppcomp.c +++ b/harbour/source/pp/ppcomp.c @@ -71,92 +71,96 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) while( ( rdlen = hb_pp_RdStr( pFile->handle, s_szLine + lens, HB_PP_STR_SIZE - lens, lContinue, ( char * ) pFile->pBuffer, &( pFile->lenBuffer ), &( pFile->iBuffer ) ) ) >= 0 ) - { - lens += rdlen; + { + lens += rdlen; - if( s_szLine[ lens - 1 ] == ';' ) + if( s_szLine[ lens - 1 ] == ';' ) + { + lContinue = 1; + lens--; + lens--; + while( s_szLine[ lens ] == ' ' || s_szLine[ lens ] == '\t' ) lens--; + s_szLine[ ++lens ] = ' '; + s_szLine[ ++lens ] = '\0'; + + hb_pp_nEmptyStrings++; + } + else + { + lContinue = 0; + lens = 0; + } + + if( !lContinue ) + { + if( *s_szLine != '\0' ) { - lContinue = 1; - lens--; - lens--; - while( s_szLine[ lens ] == ' ' || s_szLine[ lens ] == '\t' ) lens--; - s_szLine[ ++lens ] = ' '; - s_szLine[ ++lens ] = '\0'; + ptr = s_szLine; - hb_pp_nEmptyStrings++; - } - else - { - lContinue = 0; - lens = 0; - } + HB_SKIPTABSPACES( ptr ); - if( !lContinue ) - { - if( *s_szLine != '\0' ) - { - ptr = s_szLine; + if( *ptr == '#' ) + { + hb_pp_ParseDirective( ptr + 1 ); - HB_SKIPTABSPACES( ptr ); + if( pFile != hb_comp_files.pLast ) + { + pFile = ( PFILE ) ( ( PFILE ) hb_comp_files.pLast )->pPrev; - if( *ptr == '#' ) - { - hb_pp_ParseDirective( ptr + 1 ); + if( lLine ) + sprintf( s_szLine, "#line %d \"%s\"\n", pFile->iLine + hb_pp_nEmptyStrings, pFile->szFileName ); + else + *s_szLine = '\0'; - if( pFile != hb_comp_files.pLast ) - { - pFile = ( PFILE ) ( ( PFILE ) hb_comp_files.pLast )->pPrev; + lLine = 0; - if( lLine ) - sprintf( s_szLine, "#line %d \"%s\"\n", pFile->iLine + hb_pp_nEmptyStrings, pFile->szFileName ); - else - *s_szLine = '\0'; - - lLine = 0; - - pFile->iLine += ( 1 + hb_pp_nEmptyStrings ); - sprintf( s_szLine+strlen(s_szLine), "#line 1 \"%s\"", hb_comp_files.pLast->szFileName ); - hb_pp_nEmptyStrings = 0; - } - else - { - *s_szLine = '\0'; - /*hb_pp_nEmptyStrings++;*/ - hb_comp_files.pLast->iLine++; - } - } + pFile->iLine += ( 1 + hb_pp_nEmptyStrings ); + sprintf( s_szLine+strlen(s_szLine), "#line 1 \"%s\"", hb_comp_files.pLast->szFileName ); + hb_pp_nEmptyStrings = 0; + } else - { - if( *ptr == '\0' ) - { - if( hb_comp_files.iFiles == 1 ) - { - hb_pp_nEmptyStrings++; - *s_szLine = '\0'; - } - else - { - hb_comp_files.pLast->iLine++; - continue; - } - } - else if( hb_pp_nCondCompile == 0 || hb_pp_aCondCompile[ hb_pp_nCondCompile - 1 ] ) - { - hb_pp_ParseExpression( ptr, s_szOutLine ); - hb_comp_files.pLast->iLine++; - } - else - { + { + *s_szLine = '\0'; + /*hb_pp_nEmptyStrings++;*/ + hb_comp_files.pLast->iLine++; + } + } + else + { + if( *ptr == '\0' ) + { + if( hb_comp_files.iFiles == 1 ) + { + hb_pp_nEmptyStrings++; + *s_szLine = '\0'; + } + else + { + hb_comp_files.pLast->iLine++; + continue; + } + } + else + { + if( hb_pp_nCondCompile == 0 || hb_pp_aCondCompile[ hb_pp_nCondCompile - 1 ] ) + { + hb_pp_ParseExpression( ptr, s_szOutLine ); + hb_comp_files.pLast->iLine++; + } + else + { *s_szLine = '\0'; hb_pp_nEmptyStrings++; - } - } - } - else - hb_pp_nEmptyStrings++; - break; + } + } + } } - } + else + hb_pp_nEmptyStrings++; + + break; + } + } if( rdlen < 0 ) { @@ -181,13 +185,34 @@ int hb_pp_Internal( FILE * handl_o, char * sOut ) if( lLine ) { - sprintf( ptrOut, "#line %d \"%s\"", hb_comp_files.pLast->iLine /*hb_comp_iLine + hb_pp_nEmptyStrings*/, hb_comp_files.pLast->szFileName ); + sprintf( ptrOut, "#line %d \"%s\"", ( hb_comp_files.pLast->iLine += hb_pp_nEmptyStrings ) , hb_comp_files.pLast->szFileName ); while( *ptrOut ) ptrOut++; + + /* Ron Pinkas added 2000-06-14 */ + /* Ignore empty lines immediatley after resuming after #include */ + hb_pp_nEmptyStrings = 0; + /* Ron Pinkas end 2000-06-14 */ + + /* Ron Pinkas added 2000-06-14 */ + ptr = s_szLine; + HB_SKIPTABSPACES( ptr ); + + /* Last Opened file ended without CR - adding CR to the #line directive. */ + if( *ptr != '\0' ) + { + *ptrOut++ = '\n'; + *ptrOut = '\0'; + hb_comp_files.pLast->iLine++; + } + /* Ron Pinkas end 2000-06-14 */ } else { + /* Ron Pinkas added 2000-06-13 */ + /* Ignore empty lines in #included files. */ if( hb_pp_nEmptyStrings && hb_comp_files.iFiles == 1 ) - for( i=0;i