2000-07-22 23:08 GMT+3 Alexander Kresin <alex@belacy.belgorod.su>
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2000-07-22 23:08 GMT+3 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* source/compiler/harbour.c
|
||||
* source/compiler/harbour.y
|
||||
* source/compiler/hbgenerr.c
|
||||
* source/pp/ppcomp.c
|
||||
* source/pp/ppcore.c
|
||||
* Line numbering cleanups and fixes
|
||||
|
||||
2000-07-18 10:25 UTC+0200 JfL <jfl@mafact.com> & RaC <Rac@mafact.com>
|
||||
* source/vm/classes.c
|
||||
* Improvement within hb_clsinst (no more static var)
|
||||
|
||||
@@ -1908,7 +1908,7 @@ void hb_compLinePush( void ) /* generates the pcode with the currently compiled
|
||||
if( hb_comp_bLineNumbers && ! hb_comp_bDontGenLineNum )
|
||||
{
|
||||
/*
|
||||
int iLine = hb_comp_files.pLast->iLine - 1;
|
||||
int iLine = hb_comp_iLine - 1;
|
||||
|
||||
if( hb_pp_nEmptyStrings )
|
||||
iLine -= hb_pp_nEmptyStrings - 2;
|
||||
|
||||
@@ -251,13 +251,13 @@ Source : Crlf { hb_comp_EOL = FALSE; }
|
||||
| ProcReq { hb_comp_EOL = FALSE; }
|
||||
| error Crlf { hb_comp_EOL = FALSE; yyclearin; }
|
||||
| Source Crlf { hb_comp_EOL = FALSE; }
|
||||
| Source VarDefs { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| Source FieldsDef { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| Source MemvarDef { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| Source Declaration { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| Source Function { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| Source Statement { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| Source Line { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| Source VarDefs { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
| Source FieldsDef { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
| Source MemvarDef { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
| Source Declaration { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
| Source Function { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
| Source Statement { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
| Source Line { hb_comp_EOL = FALSE; hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
| Source ProcReq { hb_comp_EOL = FALSE; }
|
||||
| Source error Crlf { hb_comp_EOL = FALSE; yyclearin; }
|
||||
;
|
||||
@@ -406,7 +406,7 @@ CrlfStmnt : { hb_compLinePushIfInside(); } Crlf
|
||||
;
|
||||
|
||||
LineStat : Crlf { $<lNumber>$ = 0; hb_comp_bDontGenLineNum = TRUE; }
|
||||
| Statement { $<lNumber>$ = 1; hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| Statement { $<lNumber>$ = 1; hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
;
|
||||
|
||||
Statements : LineStat { $<lNumber>$ = $<lNumber>1; hb_compLinePush(); }
|
||||
@@ -1275,19 +1275,19 @@ EmptyStats : /* empty */ { hb_comp_bDontGenLineNum = TRUE; hb_comp_EOL
|
||||
| EmptyStatements { hb_comp_EOL = FALSE; $<lNumber>$ = $<lNumber>1; }
|
||||
;
|
||||
|
||||
IfBegin : IF SimpleExpression { ++hb_comp_wIfCounter; hb_compLinePush(); } Crlf { hb_compExprDelete( hb_compExprGenPush( $2 ) ); $$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
IfBegin : IF SimpleExpression { ++hb_comp_wIfCounter; hb_compLinePush(); } Crlf { hb_compExprDelete( hb_compExprGenPush( $2 ) ); $$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
EmptyStats
|
||||
{ $$ = hb_compGenJump( 0 ); hb_compGenJumpHere( $<iNumber>5 ); }
|
||||
|
||||
| IF Variable { ++hb_comp_wIfCounter; hb_compLinePush(); } Crlf { hb_compExprDelete( hb_compExprGenPush( $2 ) ); $$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| IF Variable { ++hb_comp_wIfCounter; hb_compLinePush(); } Crlf { hb_compExprDelete( hb_compExprGenPush( $2 ) ); $$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
EmptyStats
|
||||
{ $$ = hb_compGenJump( 0 ); hb_compGenJumpHere( $<iNumber>5 ); }
|
||||
|
||||
| IF PareExpList1 { ++hb_comp_wIfCounter; hb_compLinePush(); } Crlf { hb_compExprDelete( hb_compExprGenPush( $2 ) ); $$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| IF PareExpList1 { ++hb_comp_wIfCounter; hb_compLinePush(); } Crlf { hb_compExprDelete( hb_compExprGenPush( $2 ) ); $$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
EmptyStats
|
||||
{ $$ = hb_compGenJump( 0 ); hb_compGenJumpHere( $<iNumber>5 ); }
|
||||
|
||||
| IF PareExpList2 { ++hb_comp_wIfCounter; hb_compLinePush(); } Crlf { hb_compExprDelete( hb_compExprGenPush( $2 ) ); $$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| IF PareExpList2 { ++hb_comp_wIfCounter; hb_compLinePush(); } Crlf { hb_compExprDelete( hb_compExprGenPush( $2 ) ); $$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
EmptyStats
|
||||
{ $$ = hb_compGenJump( 0 ); hb_compGenJumpHere( $<iNumber>5 ); }
|
||||
|
||||
@@ -1296,14 +1296,14 @@ IfBegin : IF SimpleExpression { ++hb_comp_wIfCounter; hb_compLinePush(); } Cr
|
||||
{ $$ = hb_compGenJump( 0 ); hb_compGenJumpHere( $<iNumber>5 ); }
|
||||
;
|
||||
|
||||
IfElse : ELSE Crlf { hb_comp_functions.pLast->bFlags &= ~ FUN_BREAK_CODE; hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
IfElse : ELSE Crlf { hb_comp_functions.pLast->bFlags &= ~ FUN_BREAK_CODE; hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
EmptyStats
|
||||
;
|
||||
|
||||
IfElseIf : ELSEIF Expression Crlf { hb_comp_functions.pLast->bFlags &= ~ FUN_BREAK_CODE; hb_compExprDelete( hb_compExprGenPush( $2 ) ); $<iNumber>$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
IfElseIf : ELSEIF Expression Crlf { hb_comp_functions.pLast->bFlags &= ~ FUN_BREAK_CODE; hb_compExprDelete( hb_compExprGenPush( $2 ) ); $<iNumber>$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
EmptyStats { $$ = hb_compElseIfGen( NULL, hb_compGenJump( 0 ) ); hb_compGenJumpHere( $<iNumber>4 ); }
|
||||
|
||||
| IfElseIf ELSEIF Expression Crlf { hb_comp_functions.pLast->bFlags &= ~ FUN_BREAK_CODE; hb_compExprDelete( hb_compExprGenPush( $3 ) ); $<iNumber>$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
| IfElseIf ELSEIF Expression Crlf { hb_comp_functions.pLast->bFlags &= ~ FUN_BREAK_CODE; hb_compExprDelete( hb_compExprGenPush( $3 ) ); $<iNumber>$ = hb_compGenJumpFalse( 0 ); hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
EmptyStats { $$ = hb_compElseIfGen( $1, hb_compGenJump( 0 ) ); hb_compGenJumpHere( $<iNumber>5 ); }
|
||||
;
|
||||
|
||||
@@ -1338,7 +1338,7 @@ EndCase : ENDCASE
|
||||
}
|
||||
;
|
||||
|
||||
DoCaseStart : DOCASE { ++hb_comp_wCaseCounter; } Crlf { hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
DoCaseStart : DOCASE { ++hb_comp_wCaseCounter; } Crlf { hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
;
|
||||
|
||||
DoCaseBegin : DoCaseStart { }
|
||||
@@ -1355,7 +1355,7 @@ Cases : CASE Expression Crlf
|
||||
hb_compExprDelete( hb_compExprGenPush( $2 ) );
|
||||
$<iNumber>$ = hb_compGenJumpFalse( 0 );
|
||||
hb_compLinePush();
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
}
|
||||
EmptyStats
|
||||
{
|
||||
@@ -1363,7 +1363,7 @@ Cases : CASE Expression Crlf
|
||||
$$ = hb_compElseIfGen( 0, hb_compGenJump( 0 ) );
|
||||
hb_compGenJumpHere( $<iNumber>4 );
|
||||
hb_compLinePush();
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
}
|
||||
|
||||
| Cases CASE Expression Crlf
|
||||
@@ -1371,7 +1371,7 @@ Cases : CASE Expression Crlf
|
||||
hb_compExprDelete( hb_compExprGenPush( $3 ) );
|
||||
$<iNumber>$ = hb_compGenJumpFalse( 0 );
|
||||
hb_compLinePush();
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
}
|
||||
EmptyStats
|
||||
{
|
||||
@@ -1379,11 +1379,11 @@ Cases : CASE Expression Crlf
|
||||
$$ = hb_compElseIfGen( $1, hb_compGenJump( 0 ) );
|
||||
hb_compGenJumpHere( $<iNumber>5 );
|
||||
hb_compLinePush();
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
}
|
||||
;
|
||||
|
||||
Otherwise : OTHERWISE Crlf { hb_comp_functions.pLast->bFlags &= ~ FUN_BREAK_CODE; hb_compLinePush(); hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1; }
|
||||
Otherwise : OTHERWISE Crlf { hb_comp_functions.pLast->bFlags &= ~ FUN_BREAK_CODE; hb_compLinePush(); hb_comp_iCompiled = hb_comp_iLine - 1; }
|
||||
EmptyStats
|
||||
| Otherwise OTHERWISE { hb_compGenError( hb_comp_szErrors, 'E', HB_COMP_ERR_MAYHEM_IN_CASE, NULL, NULL ); } Crlf
|
||||
EmptyStats
|
||||
@@ -1394,20 +1394,20 @@ DoWhile : WhileBegin Expression Crlf
|
||||
hb_compExprDelete( hb_compExprGenPush( $2 ) );
|
||||
$<lNumber>$ = hb_compGenJumpFalse( 0 );
|
||||
hb_compLinePush();
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
}
|
||||
EmptyStats
|
||||
{
|
||||
hb_compLoopHere();
|
||||
hb_compGenJump( $1 - hb_comp_functions.pLast->lPCodePos );
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
}
|
||||
EndWhile
|
||||
{
|
||||
hb_compGenJumpHere( $<lNumber>4 ); --hb_comp_wWhileCounter;
|
||||
hb_compLoopEnd();
|
||||
hb_comp_functions.pLast->bFlags &= ~ FUN_WITH_RETURN;
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -1441,7 +1441,7 @@ ForNext : FOR LValue ForAssign Expression /* 1 2 3 4 */
|
||||
hb_compGenPCode1( HB_P_LESSEQUAL );
|
||||
$<lNumber>$ = hb_compGenJumpFalse( 0 ); /* 11 */
|
||||
hb_compLinePush();
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
}
|
||||
ForStatements /* 12 */
|
||||
{
|
||||
@@ -1565,7 +1565,7 @@ DoArgument : IdentName { $$ = hb_compExprNewVarRef( $1 ); }
|
||||
| PareExpList { $$ = $1; }
|
||||
;
|
||||
|
||||
Crlf : '\n' { ++hb_comp_iLine; hb_comp_EOL = TRUE; hb_comp_bError = FALSE; }
|
||||
Crlf : '\n' { hb_comp_EOL = TRUE; hb_comp_bError = FALSE; }
|
||||
| ';' { hb_comp_bDontGenLineNum = TRUE; }
|
||||
;
|
||||
|
||||
@@ -1674,26 +1674,9 @@ BOOL hb_compInclude( char * szFileName, PATHNAMES * pSearch )
|
||||
pFile->pBuffer = hb_xgrab( HB_PP_BUFF_SIZE );
|
||||
pFile->iBuffer = pFile->lenBuffer = 10;
|
||||
pFile->szFileName = szFileName;
|
||||
pFile->iLine = 1;
|
||||
pFile->iLine = 0;
|
||||
pFile->pPrev = NULL;
|
||||
|
||||
/*
|
||||
if( ! hb_comp_files.iFiles )
|
||||
hb_comp_files.pLast = pFile;
|
||||
else
|
||||
{
|
||||
hb_comp_files.pLast->iLine = hb_comp_iLine;
|
||||
hb_comp_iLine = 1;
|
||||
pFile->pPrev = hb_comp_files.pLast;
|
||||
hb_comp_files.pLast = pFile;
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
yy_switch_to_buffer( ( YY_BUFFER_STATE ) ( pFile->pBuffer = yy_create_buffer( yyin, 8192 * 2 ) ) );
|
||||
#else
|
||||
yy_switch_to_buffer( pFile->pBuffer = yy_create_buffer( yyin, 8192 * 2 ) );
|
||||
#endif
|
||||
*/
|
||||
|
||||
hb_comp_files.pLast = pFile;
|
||||
#ifdef __cplusplus
|
||||
yy_switch_to_buffer( ( YY_BUFFER_STATE ) ( hb_comp_buffer = ( char * ) yy_create_buffer( yyin, 8192 * 2 ) ) );
|
||||
@@ -1713,32 +1696,6 @@ int yywrap( void ) /* handles the EOF of the currently processed file */
|
||||
return 1; /* we have reached the main EOF */
|
||||
}
|
||||
|
||||
/*
|
||||
else
|
||||
{
|
||||
void * pLast;
|
||||
|
||||
pLast = hb_comp_files.pLast;
|
||||
fclose( hb_comp_files.pLast->handle );
|
||||
hb_comp_files.pLast = ( PFILE ) ( ( PFILE ) hb_comp_files.pLast )->pPrev;
|
||||
hb_comp_iLine = hb_comp_files.pLast->iLine;
|
||||
#ifdef __cplusplus
|
||||
yy_delete_buffer( ( YY_BUFFER_STATE ) ( ( PFILE ) pLast )->pBuffer );
|
||||
#else
|
||||
yy_delete_buffer( ( ( PFILE ) pLast )->pBuffer );
|
||||
#endif
|
||||
free( pLast );
|
||||
hb_comp_files.iFiles--;
|
||||
yyin = hb_comp_files.pLast->handle;
|
||||
#ifdef __cplusplus
|
||||
yy_switch_to_buffer( ( YY_BUFFER_STATE ) hb_comp_files.pLast->pBuffer );
|
||||
#else
|
||||
yy_switch_to_buffer( hb_comp_files.pLast->pBuffer );
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
*/ /* we close the currently include file and continue */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ char * hb_comp_szWarnings[] =
|
||||
|
||||
void hb_compGenError( char * szErrors[], char cPrefix, int iError, char * szError1, char * szError2 )
|
||||
{
|
||||
int iLine = hb_comp_files.pLast->iLine - 1;
|
||||
int iLine = hb_comp_iLine - 1;
|
||||
|
||||
if( cPrefix != 'F' && hb_comp_bError )
|
||||
return;
|
||||
@@ -137,7 +137,7 @@ void hb_compGenError( char * szErrors[], char cPrefix, int iError, char * szErro
|
||||
|
||||
hb_comp_iErrorCount++;
|
||||
hb_comp_bError = TRUE;
|
||||
hb_comp_iCompiled = hb_comp_files.pLast->iLine - 1;
|
||||
hb_comp_iCompiled = hb_comp_iLine - 1;
|
||||
|
||||
/* fatal error - exit immediately */
|
||||
if( cPrefix == 'F' )
|
||||
@@ -149,8 +149,7 @@ void hb_compGenWarning( char * szWarnings[], char cPrefix, int iWarning, char *
|
||||
char * szText = szWarnings[ iWarning - 1 ];
|
||||
int iLine = 0;
|
||||
|
||||
if( hb_comp_files.pLast && hb_comp_files.pLast->iLine )
|
||||
iLine = hb_comp_files.pLast->iLine - 1;
|
||||
iLine = hb_comp_iLine - 1;
|
||||
|
||||
if( ( szText[ 0 ] - '0' ) <= hb_comp_iWarnings )
|
||||
{
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
|
||||
static char s_szLine[ HB_PP_STR_SIZE ];
|
||||
static char s_szOutLine[ HB_PP_STR_SIZE ];
|
||||
static int hb_pp_LastOutLine = 1;
|
||||
|
||||
/*
|
||||
BOOL bDebug = FALSE;
|
||||
@@ -78,10 +79,7 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
&( pFile->iBuffer ) ) ) >= 0 )
|
||||
{
|
||||
lens += rdlen;
|
||||
|
||||
#if 0
|
||||
printf( "Len: %i Last: %i >%s<\n", rdlen, s_szLine[ lens - 1 ], s_szLine );
|
||||
#endif
|
||||
hb_comp_iLine ++;
|
||||
|
||||
if( s_szLine[ lens - 1 ] == ';' )
|
||||
{
|
||||
@@ -91,8 +89,6 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
while( s_szLine[ lens ] == ' ' || s_szLine[ lens ] == '\t' ) lens--;
|
||||
s_szLine[ ++lens ] = ' ';
|
||||
s_szLine[ ++lens ] = '\0';
|
||||
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -102,14 +98,9 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
|
||||
if( !lContinue )
|
||||
{
|
||||
if( *s_szLine == '\0' )
|
||||
{
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
else
|
||||
if( *s_szLine != '\0' )
|
||||
{
|
||||
ptr = s_szLine;
|
||||
|
||||
HB_SKIPTABSPACES( ptr );
|
||||
|
||||
if( *ptr == '#' )
|
||||
@@ -121,70 +112,37 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
pFile = ( PFILE ) ( ( PFILE ) hb_comp_files.pLast )->pPrev;
|
||||
|
||||
if( lLine )
|
||||
{
|
||||
sprintf( s_szLine, "#line %d \"%s\"\n", pFile->iLine + hb_pp_nEmptyStrings, pFile->szFileName );
|
||||
}
|
||||
sprintf( s_szLine, "#line %d \"%s\"\n", pFile->iLine, pFile->szFileName );
|
||||
else
|
||||
{
|
||||
*s_szLine = '\0';
|
||||
}
|
||||
|
||||
lLine = 0;
|
||||
|
||||
/* Ron Pinkas added 2000-06-23 */
|
||||
/* Produce empty lines, only if previous file is the main prg. */
|
||||
if( hb_comp_files.iFiles == 2 )
|
||||
{
|
||||
tmpPtr = s_szLine + strlen(s_szLine);
|
||||
|
||||
for( i=0; i < hb_pp_nEmptyStrings; i++ )
|
||||
*tmpPtr++ = '\n';
|
||||
|
||||
*tmpPtr = '\0';
|
||||
}
|
||||
/* Ron Pinkas end 2000-06-23 */
|
||||
|
||||
sprintf( s_szLine + strlen(s_szLine), "#line 1 \"%s\"", hb_comp_files.pLast->szFileName );
|
||||
|
||||
/* Ron Pinkas added 2000-06-23 */
|
||||
pFile->iLine += ( 1 + hb_pp_nEmptyStrings );
|
||||
hb_pp_nEmptyStrings = 0;
|
||||
/* Ron Pinkas end 2000-06-23 */
|
||||
}
|
||||
else
|
||||
{
|
||||
hb_pp_nEmptyStrings++;
|
||||
*s_szLine = '\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 ] )
|
||||
{
|
||||
if( ( hb_pp_LastOutLine < hb_comp_iLine - 1 ) && hb_comp_files.iFiles == 1 && handl_o )
|
||||
for( ; hb_pp_LastOutLine < hb_comp_iLine-1; hb_pp_LastOutLine++ )
|
||||
hb_pp_WrStr( handl_o, "\n" );
|
||||
hb_pp_LastOutLine = hb_comp_iLine;
|
||||
hb_pp_ParseExpression( ptr, s_szOutLine );
|
||||
hb_comp_files.pLast->iLine++;
|
||||
}
|
||||
else
|
||||
{
|
||||
*s_szLine = '\0';
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,12 +157,6 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
return 0; /* we have reached the main EOF */
|
||||
else
|
||||
{
|
||||
/* Ron Pinkas added 2000-06-23 */
|
||||
/* Resumming Main PRG */
|
||||
if( hb_comp_files.iFiles == 2 )
|
||||
{
|
||||
}
|
||||
|
||||
/* we close the currently include file and continue */
|
||||
fclose( hb_comp_files.pLast->handle );
|
||||
hb_xfree( hb_comp_files.pLast->pBuffer );
|
||||
@@ -213,14 +165,7 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
hb_xfree( hb_comp_files.pLast );
|
||||
hb_comp_files.pLast = pFile;
|
||||
|
||||
/* Ron Pinkas commented
|
||||
hb_comp_iLine = hb_comp_files.pLast->iLine;
|
||||
*/
|
||||
|
||||
/* Ron Pinkas added 2000-06-26 */
|
||||
hb_pp_nEmptyStrings = 0;
|
||||
/* Ron Pinkas end 2000-06-26 */
|
||||
|
||||
hb_comp_files.iFiles--;
|
||||
lLine = 1;
|
||||
}
|
||||
@@ -236,14 +181,11 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
|
||||
if( lLine )
|
||||
{
|
||||
if( hb_comp_files.iFiles == 1 )
|
||||
hb_pp_LastOutLine = hb_comp_iLine;
|
||||
sprintf( ptrOut, "#line %d \"%s\"", ( hb_comp_files.pLast->iLine ) , 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 */
|
||||
tmpPtr = s_szLine;
|
||||
HB_SKIPTABSPACES( tmpPtr );
|
||||
@@ -253,7 +195,6 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
{
|
||||
*ptrOut++ = '\n';
|
||||
*ptrOut = '\0';
|
||||
hb_comp_files.pLast->iLine++;
|
||||
}
|
||||
/* Ron Pinkas end 2000-06-14 */
|
||||
}
|
||||
@@ -261,10 +202,10 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
{
|
||||
/* Ron Pinkas added 2000-06-13 */
|
||||
/* Ignore empty lines in #included files. */
|
||||
if( hb_pp_nEmptyStrings && hb_comp_files.iFiles == 1 )
|
||||
if( ( hb_pp_LastOutLine != hb_comp_iLine ) && hb_comp_files.iFiles == 1 && handl_o )
|
||||
/* Ron Pinkas end 2000-06-13 */
|
||||
for( i=0; i < hb_pp_nEmptyStrings; i++ )
|
||||
*ptrOut++ = '\n';
|
||||
for( ; hb_pp_LastOutLine < hb_comp_iLine; hb_pp_LastOutLine++ )
|
||||
hb_pp_WrStr( handl_o, "\n" );
|
||||
}
|
||||
|
||||
lens = hb_pp_strocpy( ptrOut, s_szLine ) + ( ptrOut - sOut );
|
||||
@@ -272,15 +213,10 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
*( sOut + lens++ ) = '\n';
|
||||
*( sOut + lens ) = '\0';
|
||||
|
||||
hb_comp_files.pLast->iLine += hb_pp_nEmptyStrings;
|
||||
|
||||
#if 0
|
||||
printf( "Line: %i >%s<\n", hb_comp_files.pLast->iLine, sOut );
|
||||
#endif
|
||||
|
||||
if( handl_o )
|
||||
hb_pp_WrStr( handl_o, sOut );
|
||||
|
||||
// printf( "%d : %s\n",hb_comp_iLine,sOut );
|
||||
return lens;
|
||||
}
|
||||
|
||||
|
||||
@@ -2963,9 +2963,8 @@ static BOOL OpenInclude( char * szFileName, PATHNAMES * pSearch, PHB_FNAME pMain
|
||||
pFile->szFileName = (char*) hb_xgrab( strlen( szFileName ) + 1 );
|
||||
hb_pp_strocpy( pFile->szFileName, szFileName );
|
||||
|
||||
/*
|
||||
hb_comp_files.pLast->iLine = hb_comp_iLine;
|
||||
*/
|
||||
hb_comp_iLine = 1;
|
||||
|
||||
pFile->iLine = 1;
|
||||
pFile->pPrev = hb_comp_files.pLast;
|
||||
|
||||
Reference in New Issue
Block a user