20000317-10:53 GMT+1 Victor Szakats <info@szelvesz.hu>
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
20000317-10:53 GMT+1 Victor Szakats <info@szelvesz.hu>
|
||||
* include/hbclass.ch
|
||||
! To avoid warning _CLASS_NAME_ is #undef-ed before #define-ed.
|
||||
* include/hbpp.h
|
||||
source/compiler/hbgenerr.c
|
||||
source/pp/*
|
||||
! nEmptyString global variable prefixed with "hb_"
|
||||
! nEmptyString declaration moved to the header file.
|
||||
|
||||
20000317-09:56 GMT+3 Alexander Kresin
|
||||
* source/pp/stdalone/hbpp.c
|
||||
* source/pp/ppcomp.c
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
static oClass ;;
|
||||
if oClass == nil ;;
|
||||
oClass = TClass():New( <(ClassName)> [,<(SuperClass)>] ) ;;
|
||||
#undef _CLASS_NAME_ ;;
|
||||
#define _CLASS_NAME_ <ClassName> ;;
|
||||
#translate CLSMETH <ClassName> <MethodName>() => @<ClassName>_<MethodName>() ;
|
||||
[ ; #translate Super : => ::<SuperClass>: ] ;
|
||||
|
||||
@@ -95,6 +95,7 @@ extern int * hb_pp_aCondCompile;
|
||||
extern int hb_pp_nCondCompile;
|
||||
extern char * hb_pp_szErrors[];
|
||||
extern char * hb_pp_szWarnings[];
|
||||
extern int hb_pp_nEmptyStrings;
|
||||
|
||||
/* TABLE.C exported variables */
|
||||
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
|
||||
#include "hbcomp.h"
|
||||
|
||||
extern int nEmptyStrings;
|
||||
|
||||
/* Table with parse errors */
|
||||
char * hb_comp_szErrors[] =
|
||||
{
|
||||
@@ -115,7 +113,7 @@ char * hb_comp_szWarnings[] =
|
||||
void hb_compGenError( char * szErrors[], char cPrefix, int iError, char * szError1, char * szError2 )
|
||||
{
|
||||
if( hb_comp_files.pLast != NULL && hb_comp_files.pLast->szFileName != NULL )
|
||||
printf( "\r%s(%i) ", hb_comp_files.pLast->szFileName, hb_comp_iLine + nEmptyStrings );
|
||||
printf( "\r%s(%i) ", hb_comp_files.pLast->szFileName, hb_comp_iLine + hb_pp_nEmptyStrings );
|
||||
|
||||
printf( "Error %c%04i ", cPrefix, iError );
|
||||
printf( szErrors[ iError - 1 ], szError1, szError2 );
|
||||
@@ -135,7 +133,7 @@ void hb_compGenWarning( char * szWarnings[], char cPrefix, int iWarning, char *
|
||||
if( ( szText[ 0 ] - '0' ) <= hb_comp_iWarnings )
|
||||
{
|
||||
if( hb_comp_files.pLast != NULL && hb_comp_files.pLast->szFileName != NULL )
|
||||
printf( "\r%s(%i) ", hb_comp_files.pLast->szFileName, hb_comp_iLine + nEmptyStrings );
|
||||
printf( "\r%s(%i) ", hb_comp_files.pLast->szFileName, hb_comp_iLine + hb_pp_nEmptyStrings );
|
||||
printf( "Warning %c%04i ", cPrefix, iWarning );
|
||||
printf( szText + 1, szWarning1, szWarning2 );
|
||||
printf( "\n" );
|
||||
|
||||
@@ -49,8 +49,6 @@
|
||||
#include "hbpp.h"
|
||||
#include "hbcomp.h"
|
||||
|
||||
extern int nEmptyStrings;
|
||||
|
||||
static char s_szLine[ HB_PP_STR_SIZE ];
|
||||
static char s_szOutLine[ HB_PP_STR_SIZE ];
|
||||
|
||||
@@ -64,7 +62,7 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("PreProcess(%p, %p, %s)", handl_o, sOut));
|
||||
|
||||
nEmptyStrings = 0;
|
||||
hb_pp_nEmptyStrings = 0;
|
||||
while( TRUE )
|
||||
{
|
||||
pFile = hb_comp_files.pLast;
|
||||
@@ -85,7 +83,7 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
s_szLine[ ++lens ] = ' ';
|
||||
s_szLine[ ++lens ] = '\0';
|
||||
|
||||
nEmptyStrings++;
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -107,19 +105,19 @@ 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+nEmptyStrings, pFile->szFileName );
|
||||
pFile->iLine+hb_pp_nEmptyStrings, pFile->szFileName );
|
||||
else
|
||||
*s_szLine = '\0';
|
||||
lLine = 0;
|
||||
pFile->iLine += 1+nEmptyStrings;
|
||||
pFile->iLine += 1+hb_pp_nEmptyStrings;
|
||||
sprintf( s_szLine+strlen(s_szLine), "#line 1 \"%s\"",
|
||||
hb_comp_files.pLast->szFileName );
|
||||
nEmptyStrings = 0;
|
||||
hb_pp_nEmptyStrings = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*s_szLine = '\0';
|
||||
nEmptyStrings++;
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -131,12 +129,12 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
else
|
||||
{
|
||||
*s_szLine = '\0';
|
||||
nEmptyStrings++;
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
nEmptyStrings++;
|
||||
hb_pp_nEmptyStrings++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -155,20 +153,20 @@ int hb_pp_Internal( FILE * handl_o, char * sOut )
|
||||
hb_comp_iLine = hb_comp_files.pLast->iLine;
|
||||
hb_comp_files.iFiles--;
|
||||
lLine = 1;
|
||||
nEmptyStrings = 0;
|
||||
hb_pp_nEmptyStrings = 0;
|
||||
}
|
||||
}
|
||||
if( *s_szLine ) break;
|
||||
}
|
||||
if( lLine )
|
||||
{
|
||||
sprintf( ptrOut, "#line %d \"%s\"\n",hb_comp_iLine+nEmptyStrings,hb_comp_files.pLast->szFileName );
|
||||
sprintf( ptrOut, "#line %d \"%s\"\n",hb_comp_iLine+hb_pp_nEmptyStrings,hb_comp_files.pLast->szFileName );
|
||||
while( *ptrOut ) ptrOut++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( nEmptyStrings )
|
||||
for( i=0;i<nEmptyStrings;i++ )
|
||||
if( hb_pp_nEmptyStrings )
|
||||
for( i=0;i<hb_pp_nEmptyStrings;i++ )
|
||||
*ptrOut++ = '\n';
|
||||
}
|
||||
lens = hb_pp_strocpy( ptrOut, s_szLine ) + ( ptrOut - sOut );
|
||||
|
||||
@@ -155,7 +155,7 @@ static int s_numBrackets;
|
||||
static char s_groupchar;
|
||||
static char s_prevchar;
|
||||
|
||||
int nEmptyStrings;
|
||||
int hb_pp_nEmptyStrings;
|
||||
int * hb_pp_aCondCompile = NULL;
|
||||
int hb_pp_nCondCompile = 0;
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ PATHNAMES * hb_comp_pIncludePath = NULL;
|
||||
PHB_FNAME hb_comp_pFileName = NULL;
|
||||
FILES hb_comp_files;
|
||||
int hb_comp_iLine; /* currently parsed file line number */
|
||||
extern int nEmptyStrings;
|
||||
|
||||
/* These are need for the PP #pragma support */
|
||||
BOOL hb_comp_bPPO = FALSE; /* flag indicating, is ppo output needed */
|
||||
|
||||
@@ -64,7 +64,6 @@ PATHNAMES * hb_comp_pIncludePath = NULL;
|
||||
PHB_FNAME hb_comp_pFileName = NULL;
|
||||
FILES hb_comp_files;
|
||||
int hb_comp_iLine = 1; /* currently parsed file line number */
|
||||
extern int nEmptyStrings;
|
||||
|
||||
/* These are need for the PP #pragma support */
|
||||
BOOL hb_comp_bPPO = FALSE; /* flag indicating, is ppo output needed */
|
||||
@@ -239,7 +238,7 @@ int hb_pp_Parse( FILE * handl_o )
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("PreProcess(%p, %p, %s)", handl_o, sOut));
|
||||
|
||||
nEmptyStrings = 0;
|
||||
hb_pp_nEmptyStrings = 0;
|
||||
while( TRUE )
|
||||
{
|
||||
pFile = hb_comp_files.pLast;
|
||||
@@ -259,7 +258,7 @@ int hb_pp_Parse( FILE * handl_o )
|
||||
s_szLine[ ++lens ] = ' ';
|
||||
s_szLine[ ++lens ] = '\0';
|
||||
|
||||
nEmptyStrings++;
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -282,20 +281,20 @@ int hb_pp_Parse( FILE * handl_o )
|
||||
pFile = ( PFILE ) ( ( PFILE ) hb_comp_files.pLast )->pPrev;
|
||||
if( lLine )
|
||||
sprintf( s_szLine, "#line %d \"%s\"\n",
|
||||
pFile->iLine+nEmptyStrings, pFile->szFileName );
|
||||
pFile->iLine+hb_pp_nEmptyStrings, pFile->szFileName );
|
||||
else
|
||||
*s_szLine = '\0';
|
||||
lLine = 0;
|
||||
pFile->iLine += 1+nEmptyStrings;
|
||||
pFile->iLine += 1+hb_pp_nEmptyStrings;
|
||||
sprintf( s_szLine+strlen(s_szLine), "#line 1 \"%s\"",
|
||||
hb_comp_files.pLast->szFileName );
|
||||
nEmptyStrings = 0;
|
||||
hb_pp_nEmptyStrings = 0;
|
||||
hb_comp_iLine = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*s_szLine = '\0';
|
||||
nEmptyStrings++;
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -307,12 +306,12 @@ int hb_pp_Parse( FILE * handl_o )
|
||||
else
|
||||
{
|
||||
*s_szLine = '\0';
|
||||
nEmptyStrings++;
|
||||
hb_pp_nEmptyStrings++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
nEmptyStrings++;
|
||||
hb_pp_nEmptyStrings++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -331,22 +330,22 @@ int hb_pp_Parse( FILE * handl_o )
|
||||
hb_comp_iLine = hb_comp_files.pLast->iLine;
|
||||
hb_comp_files.iFiles--;
|
||||
lLine = 1;
|
||||
nEmptyStrings = 0;
|
||||
hb_pp_nEmptyStrings = 0;
|
||||
}
|
||||
}
|
||||
if( *s_szLine ) break;
|
||||
}
|
||||
if( lLine )
|
||||
fprintf( handl_o, "#line %d \"%s\"\n",hb_comp_iLine+nEmptyStrings,hb_comp_files.pLast->szFileName );
|
||||
fprintf( handl_o, "#line %d \"%s\"\n",hb_comp_iLine+hb_pp_nEmptyStrings,hb_comp_files.pLast->szFileName );
|
||||
else
|
||||
{
|
||||
if( nEmptyStrings )
|
||||
for( i=0;i<nEmptyStrings;i++ )
|
||||
if( hb_pp_nEmptyStrings )
|
||||
for( i=0;i<hb_pp_nEmptyStrings;i++ )
|
||||
fwrite("\n",1,1,handl_o);
|
||||
}
|
||||
if( handl_o )
|
||||
hb_pp_WrStr( handl_o, s_szLine );
|
||||
hb_comp_iLine += nEmptyStrings+1;
|
||||
hb_comp_iLine += hb_pp_nEmptyStrings+1;
|
||||
|
||||
return strlen( s_szLine );
|
||||
}
|
||||
|
||||
@@ -513,6 +513,8 @@ FUNCTION ProcessFiles()
|
||||
NEXT
|
||||
|
||||
RETURN NIL
|
||||
|
||||
#undef CRLF
|
||||
#define CRLF chr(13)+chr(10)
|
||||
|
||||
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
|
||||
|
||||
Reference in New Issue
Block a user