Updating preprocessor files

This commit is contained in:
Alexander S.Kresin
1999-07-02 08:27:39 +00:00
parent 8e3b780df5
commit 13bc1c4449
2 changed files with 34 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
* $Id$
*/
/* Harbour Preprocessor , version 0.9
/* Harbour Preprocessor , version 0.99
author - Alexander Kresin */
#if defined(__GNUC__)
@@ -736,11 +736,13 @@ int CommandStuff ( char *ptrmp, char *inputLine, char * ptro, int *lenres, int c
}
break;
case '\1': /* Match marker */
if ( (rez = WorkMarkers( &ptrmp, &ptri, ptro, lenres, nbr )) ==0 )
return 0;
else if ( rez == 2 )
if ( (rez = WorkMarkers( &ptrmp, &ptri, ptro, lenres, nbr )) == 0 )
{
SkipOptional( &ptrmp, ptro, lenres, &nbr);
if ( nbr )
{
SkipOptional( &ptrmp, ptro, lenres, &nbr);
}
else return 0;
}
break;
case '\0':
@@ -789,11 +791,18 @@ int WorkMarkers( char **ptrmp, char **ptri, char *ptro, int *lenres, int nbr )
int rezrestr, ipos;
char *ptr, *ptrtemp;
if ( **ptri == ',' ) return 0;
/* Copying a match pattern to 'exppatt' */
lenpatt = stroncpy ( exppatt, *ptrmp, 4 );
*ptrmp += 4;
SKIPTABSPACES ( *ptrmp );
if ( **ptri == ',' )
{
if ( nbr )
{
SearnRep( exppatt,"",0,ptro,lenres);
return 0;
}
}
if ( *(exppatt+2) != '2' && **ptrmp != '\1' && **ptrmp != ',' &&
**ptrmp != '[' && **ptrmp != ']' && **ptrmp != '\0' )
{
@@ -803,9 +812,23 @@ int WorkMarkers( char **ptrmp, char **ptri, char *ptro, int *lenres, int nbr )
lenreal = stroncpy( expreal, *ptri, ipos-1 );
if ( isExpres ( expreal ) )
*ptri += lenreal;
else return 0;
else
{
if ( nbr )
{
SearnRep( exppatt,"",0,ptro,lenres);
return 0;
}
}
}
else
{
if ( nbr )
{
SearnRep( exppatt,"",0,ptro,lenres);
return 0;
}
}
else return 0;
}
if ( *(exppatt+2) == '4' ) /* ---- extended match marker */
@@ -866,9 +889,8 @@ int WorkMarkers( char **ptrmp, char **ptri, char *ptro, int *lenres, int nbr )
if ( nbr )
{
SearnRep( exppatt,"",0,ptro,lenres);
return 2;
return 0;
}
else return 0;
}
}
else if ( *(exppatt+2) == '1' ) /* ---- list match marker */

View File

@@ -267,8 +267,8 @@ COMMANDS aCommands[] =
{0,"SET","FILTER TO","dbClearFilter(NIL)"},
{0,"SET","FILTER TO \1A00","dbSetFilter( \1A40, \1A20 )"},
{0,"SET","FILTER TO \1A20&>","if ( Empty(\1A30) ) ; dbClearFilter() ; else ; dbSetFilter(\1A40,\1A30) ; end"},
{0,"REPLACE","[ \1A00 WITH \1B00 [, \1C00 WITH \1D00] ] [FOR \1E00] [WHILE \1F00] [NEXT \1G00] [RECORD \1H00] [\1I20REST>] [ALL]"},
{0,"DBEval( {|| _FIELD->\1A00 := \1B00 [,_FIELD->\1C00 := \1D00]},\1E40,\1F40,\1G00,\1H00,\1I50)"},
{0,"REPLACE","[ \1A00 WITH \1B00 [, \1C00 WITH \1D00] ] [FOR \1E00] [WHILE \1F00] [NEXT \1G00] [RECORD \1H00] [\1I20REST>] [ALL]",
"DBEval( {|| _FIELD->\1A00 := \1B00 [,_FIELD->\1C00 := \1D00]},\1E40,\1F40,\1G00,\1H00,\1I50)"},
{0,"REPLACE","\1A00 WITH \1B00 [, \1C00 WITH \1D00 ]","_FIELD->\1A00 := \1B00 [; _FIELD->\1C00 := \1D00]"},
{0,"DELETE","[FOR \1A00] [WHILE \1B00] [NEXT \1C00] [RECORD \1D00] [\1E20REST>] [ALL]"},
{0,"DBEval( {|| dbDelete()}, \1A40, \1B40, \1C00, \1D00, \1E50 )"},