From c9f07c5672992e4547ca70008f7d5fe8c81a2b3d Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Mon, 26 Jun 2000 11:24:17 +0000 Subject: [PATCH] source/pp/ppcore.c --- harbour/source/pp/ppcore.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 98e56fb335..824dbe5b41 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -1186,6 +1186,7 @@ static int CommandStuff( char * ptrmp, char * inputLine, char * ptro, int * lenr int ipos; char * lastopti[ 3 ], * strtopti = NULL, * strtptri = NULL; char * ptri = inputLine, * ptr, tmpname[ MAX_NAME ]; + int isWordInside = 0; /* printf( "MP: >%s<\nIn: >%s<\n", ptrmp, ptri ); @@ -1272,6 +1273,7 @@ static int CommandStuff( char * ptrmp, char * inputLine, char * ptro, int * lenr } switch( *ptrmp ) { case '[': + isWordInside = 0; s_numBrackets++; s_aIsRepeate[ s_Repeate ] = 0; lastopti[s_Repeate++] = ptrmp; @@ -1312,12 +1314,21 @@ static int CommandStuff( char * ptrmp, char * inputLine, char * ptro, int * lenr else ptrmp = lastopti[s_Repeate]; } - else ptrmp++; + else + { + if( !isWordInside ) strtopti = NULL; + ptrmp++; + } s_numBrackets--; } - else { s_numBrackets--; ptrmp++; } + else + { + if( !isWordInside ) strtopti = NULL; + s_numBrackets--; ptrmp++; + } break; case ',': + isWordInside = 1; if( !s_numBrackets ) strtopti = NULL; if( *ptri == ',' ) { ptrmp++; ptri++; } else @@ -1331,6 +1342,7 @@ static int CommandStuff( char * ptrmp, char * inputLine, char * ptro, int * lenr break; case '\1': /* Match marker */ if( !s_numBrackets ) strtopti = NULL; + if( *(ptrmp+2) == '2' ) isWordInside = 1; /* restricted match marker */ if( !WorkMarkers( &ptrmp, &ptri, ptro, lenres, com_or_xcom ) ) { if( s_numBrackets ) @@ -1346,6 +1358,7 @@ static int CommandStuff( char * ptrmp, char * inputLine, char * ptro, int * lenr else endTranslation = TRUE; break; default: /* Key word */ + isWordInside = 1; if( !s_numBrackets ) strtopti = NULL; ptr = ptri; if( *ptri == ',' || truncmp( &ptri, &ptrmp, !com_or_xcom ) ) @@ -1471,6 +1484,12 @@ static int WorkMarkers( char ** ptrmp, char ** ptri, char * ptro, int * lenres, { ptrtemp++; HB_SKIPTABSPACES( ptrtemp ); + while( *ptrtemp == '[' ) + { + while( *ptrtemp != ']' ) ptrtemp++; + ptrtemp++; + HB_SKIPTABSPACES( ptrtemp ); + } } if( *(exppatt+2) != '2' && *ptrtemp != '\1' && *ptrtemp != ',' && *ptrtemp != '[' && *ptrtemp != ']' && *ptrtemp != '\0' )