2001-06-22 07:30 UTC-0800 Ron Pinkas <ron@profit-master.com>

* source/pp/ppcore.c
     + Added logic for new Idenitifier Match Marker <!AnyId!> which will only match Identifiers.
     + Added static BOOL IsIdentifier( char *szProspect )

   * include/hbclass.ch
     ! Changed <name> to <!name!> in 3 VO OO compatibility rules, where regular match marker was TOO generic.
     ! Reinstated default #define HB_CLS_VO
This commit is contained in:
Ron Pinkas
2001-06-22 14:31:24 +00:00
parent 6a4f162322
commit c57f209fda
3 changed files with 61 additions and 10 deletions

View File

@@ -1,3 +1,12 @@
2001-06-22 07:30 UTC-0800 Ron Pinkas <ron@profit-master.com>
* source/pp/ppcore.c
+ Added logic for new Idenitifier Match Marker <!AnyId!> which will only match Identifiers.
+ Added static BOOL IsIdentifier( char *szProspect )
* include/hbclass.ch
! Changed <name> to <!name!> in 3 VO OO compatibility rules, where regular match marker was TOO generic.
! Reinstated default #define HB_CLS_VO
2001-06-22 06:10 UTC-0800 Ron Pinkas <ron@profit-master.com>
* include/hbclass.ch
! Un-Commented out 3 rules used for VO OO and #undefed HB_CLS_VO instead.

View File

@@ -131,7 +131,7 @@ DECLARE TClass ;
/* IF NOTHING DECIDED BY THE PROGRAMER USE ALL */
#define HB_CLS_FWO
#define HB_CLS_CSY
//#define HB_CLS_VO
#define HB_CLS_VO
#define HB_CLS_TOP
#endif
@@ -251,10 +251,9 @@ DECLARE TClass ;
/* VO SYNTAX */
#ifdef HB_CLS_VO
// *** These rules are TOO generic and have undesired side effects!!!
#xtranslate ( <name>{ [<p,...>] } => ( <name>():New( <p> )
#xtranslate = <name>{ [<p,...>] } => = <name>():New( <p> )
#xtranslate , <name>{ [<p,...>] } => , <name>():New( <p> )
#xtranslate ( <!name!>{ [<p,...>] } => ( <name>():New( <p> )
#xtranslate = <!name!>{ [<p,...>] } => = <name>():New( <p> )
#xtranslate , <!name!>{ [<p,...>] } => , <name>():New( <p> )
#xcommand EXPORT <DataNames,...> [ AS <type> ] [ INIT <uValue> ] [<ro: READONLY, RO>] => ;
_HB_MEMBER {[AS <type>] <DataNames>} ;;

View File

@@ -131,6 +131,7 @@ static int NextWord( char **, char *, BOOL );
static int NextName( char **, char * );
static int NextParm( char **, char * );
static BOOL OpenInclude( char *, PATHNAMES *, PHB_FNAME, BOOL bStandardOnly, char * );
static BOOL IsIdentifier( char *szProspect );
#define ISNAME( c ) ( isalnum( ( int ) c ) || ( c ) == '_' || ( c ) > 0x7E )
#define MAX_NAME 255
@@ -897,6 +898,8 @@ static void ConvertPatterns( char * mpatt, int mlen, char * rpatt, int rlen )
{ exptype = '3'; i++; }
else if( *(mpatt+i) == '(' ) /* Extended expression match marker */
{ exptype = '4'; i++; }
else if( *(mpatt+i) == '!' ) /* Extended expression match marker */
{ exptype = '5'; i++; }
ptr = mpatt + i;
while( *ptr != '>' )
{
@@ -937,6 +940,12 @@ static void ConvertPatterns( char * mpatt, int mlen, char * rpatt, int rlen )
else
hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_PATTERN_DEFINITION, NULL, NULL );
}
else if( exptype == '5' )
{
if( *(exppatt+explen-1) == '!' ) explen--;
else
hb_compGenError( hb_pp_szErrors, 'F', HB_PP_ERR_PATTERN_DEFINITION, NULL, NULL );
}
rmlen = i - ipos + 1;
/* Convert match marker into inner format */
@@ -1784,12 +1793,25 @@ static int WorkMarkers( char ** ptrmp, char ** ptri, char * ptro, int * lenres,
printf( "\nExpr: '%s' ptrtemp: '%s' exppat: '%s'\n", expreal, ptrtemp, exppatt );
#endif
if( ipos > 1 && isExpres( expreal ) )
if( ipos > 1 )
{
/*
printf( "Accepted: >%s<\n", expreal );
*/
*ptri += lenreal;
if( *(exppatt+2) == '5' ) /* ---- Minimal match marker */
{
if( IsIdentifier( expreal ) )
{
/*
printf( "Accepted ID: >%s<\n", expreal );
*/
*ptri += lenreal;
}
}
else if( isExpres( expreal ) )
{
/*
printf( "Accepted: >%s<\n", expreal );
*/
*ptri += lenreal;
}
}
else
{
@@ -3778,6 +3800,27 @@ static int NextParm( char ** sSource, char * sDest )
return lenName;
}
static BOOL IsIdentifier( char *szProspect )
{
if( isalpha( szProspect[0] ) || szProspect[0] == '_' )
{
int i = 1;
while( ISNAME( szProspect[i] ) )
{
i++;
}
while( szProspect[i] == ' ' )
{
i++;
}
return ( szProspect[i] == '\0' ) ;
}
return FALSE;
}
static BOOL OpenInclude( char * szFileName, PATHNAMES * pSearch, PHB_FNAME pMainFileName, BOOL bStandardOnly, char * szInclude )
{
FILE * fptr;