2000-08-02 09:40 UTC+0800 Ron Pinkas <ron@profit-master.com>

* source/macro/macro.l
   * source/macro/macro.y
     + Added: #define yylex hb_complex

   * source/pp/ppcore.c
     + Added check for the file path when checking self reference of #include.
     + Added logic to ignore case when checing self reference of #include.
This commit is contained in:
Ron Pinkas
2000-08-02 16:43:49 +00:00
parent 80ae316cf9
commit 685b646051
4 changed files with 29 additions and 8 deletions

View File

@@ -1,3 +1,12 @@
2000-08-02 09:40 UTC+0800 Ron Pinkas <ron@profit-master.com>
* source/macro/macro.l
* source/macro/macro.y
+ Added: #define yylex hb_complex
* source/pp/ppcore.c
+ Added check for the file path when checking self reference of #include.
+ Added logic to ignore case when checing self reference of #include.
2000-08-02 15:54 UTC+0300 Chen Kedem <niki@actcom.co.il>
* doc/simplex.txt

View File

@@ -48,6 +48,7 @@ NOTE: -C controls the speed/size ratio of generated scanner
*/
#define HB_MACRO_SUPPORT
#define yylex hb_complex
#include <stdio.h>
#include <stdlib.h>
@@ -117,7 +118,7 @@ MacroTxt ({MacroVar}|{MacroEnd}|{MacroId})+
' BEGIN STRING1;
\" BEGIN STRING2;
\[ {
\[ {
if( pMacro->FlexState == SEPARATOR )
BEGIN STRING3;
else

View File

@@ -44,6 +44,7 @@
/* this #define HAVE TO be placed before all #include directives
*/
#define HB_MACRO_SUPPORT
#define yylex hb_complex
#include "hbmacro.h"
#include "hbcomp.h"
@@ -205,15 +206,15 @@ Main : Expression '\n' {
hb_compExprDelete( hb_compExprGenPop( $1, HB_MACRO_PARAM ), HB_MACRO_PARAM );
hb_compGenPCode1( HB_P_ENDPROC, HB_MACRO_PARAM );
}
| Expression error {
| Expression error {
HB_TRACE(HB_TR_DEBUG, ("macro -> invalid expression: %s", HB_MACRO_DATA->string));
hb_macroError( EG_SYNTAX, HB_MACRO_PARAM );
hb_macroError( EG_SYNTAX, HB_MACRO_PARAM );
hb_compExprDelete( $1, HB_MACRO_PARAM );
YYABORT;
}
| error {
| error {
HB_TRACE(HB_TR_DEBUG, ("macro -> invalid syntax: %s", HB_MACRO_DATA->string));
hb_macroError( EG_SYNTAX, HB_MACRO_PARAM );
hb_macroError( EG_SYNTAX, HB_MACRO_PARAM );
YYABORT;
}
;

View File

@@ -2916,11 +2916,21 @@ static BOOL OpenInclude( char * szFileName, PATHNAMES * pSearch, PHB_FNAME pMain
{
pFileName = hb_fsFNameSplit( szFileName );
if( strcmp( pFileName->szName, pMainFileName->szName ) == 0 && strcmp( pFileName->szExtension, pMainFileName->szExtension ) )
hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_INCLUDE_SELF, szFileName, NULL );
if( pFileName->szPath == NULL || *(pFileName->szPath) == '\0' )
pFileName->szPath = pMainFileName->szPath;
/*
printf( "Name=%s Ext=%s Path=%s\n", pFileName->szName, pFileName->szExtension, pFileName->szPath );
printf( "Name=%s Ext=%s Path=%s\n", pMainFileName->szName, pMainFileName->szExtension, pMainFileName->szPath );
*/
if( strcmp( hb_strupr( pFileName->szName ), hb_strupr( pMainFileName->szName ) ) == 0 &&
( ( pFileName->szExtension == NULL && pMainFileName->szExtension == NULL ) ||
( pFileName->szExtension && pMainFileName->szExtension &&
strcmp( hb_strupr( pFileName->szExtension ), hb_strupr( pMainFileName->szExtension ) ) == 0 ) ) &&
( pFileName->szPath == NULL || strcmp( hb_strupr( pFileName->szPath ), hb_strupr( pMainFileName->szPath ) ) == 0 ) )
hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_INCLUDE_SELF, szFileName, NULL );
hb_fsFNameMerge( szInclude, pFileName );
fptr = fopen( szInclude, "r" );
hb_xfree( pFileName );