From 641d0c4c5abe03dcacfb3fe0eaccfe136f72a19d Mon Sep 17 00:00:00 2001 From: Ryszard Glab Date: Tue, 23 Mar 2004 13:31:11 +0000 Subject: [PATCH] 2004-03-23 14:50 UTC+0100 Ryszard Glab * source/pp/ppcore.c * fixed parsing of nested #defines in command/translate for example: #define PRE_CHAR 'A' #define IDX_EXPR(x) PRE_CHAR+x INDEX ON IDX_EXPR(myfield) TO myfile * source/pp/pptable.c * updated for fixes in ppcore.c (_DFSET define) --- harbour/ChangeLog | 11 +++++++++++ harbour/source/pp/ppcore.c | 11 ++++++----- harbour/source/pp/pptable.c | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4715b2987d..61b0d8a9f7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,17 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2004-03-23 14:50 UTC+0100 Ryszard Glab + * source/pp/ppcore.c + * fixed parsing of nested #defines in command/translate + for example: + #define PRE_CHAR 'A' + #define IDX_EXPR(x) PRE_CHAR+x + INDEX ON IDX_EXPR(myfield) TO myfile + + * source/pp/pptable.c + * updated for fixes in ppcore.c (_DFSET define) + 2004-03-21 21:48 UTC-0800 Luis Krause Mantilla * source/rtl/tbcolumn.prg + added PreBlock and PostBlock instance variables for Clipper 5.3x compatibility diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 975c3d084a..35ea8c2a11 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -1166,7 +1166,7 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) rezDef = 0; rezTra = 0; rezCom = 0; isdvig = 0; - + do { ptro = sOutLine; @@ -1222,13 +1222,11 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) } hb_pp_Stuff( ptro, ptrb, i, ptri-ptrb, lens+1 ); - if( ipos > 0 ) { ipos += i - (ptri-ptrb); *(sLine + isdvig + ipos - 1) = '\0'; } - ptri += i - (ptri-ptrb); } } @@ -1241,6 +1239,8 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) printf( "After #defines: >%s<\n", sLine ); #endif + if( rezDef == 0 ) + { /* Look for definitions from #translate */ stcmd = hb_pp_topTranslate; while( stcmd != NULL ) @@ -1284,7 +1284,8 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) stcmd = stcmd->last; } - + } /* rezDef == 0 */ + #if 0 if( *sOutLine ) printf( "*After #translate: >%s<\n", sOutLine ); @@ -1295,7 +1296,7 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) /* Look for definitions from #command */ /* JFL ! Was 3 but insufficient in most cases */ /* I know this is a new hardcoded limit ... any better idea's welcome */ - if( kolpass < 20 ) + if( rezDef==0 && rezTra==0 && kolpass < 20 ) { ptri = sLine + isdvig; HB_SKIPTABSPACES( ptri ); diff --git a/harbour/source/pp/pptable.c b/harbour/source/pp/pptable.c index 4cc169c73e..c99232a142 100644 --- a/harbour/source/pp/pptable.c +++ b/harbour/source/pp/pptable.c @@ -110,7 +110,7 @@ void hb_pp_Table( void ) static DEFINES sD___39 = {"_SET_WRAP",NULL,-1,"35", &sD___38 }; static DEFINES sD___40 = {"_SET_COUNT",NULL,-1,"47", &sD___39 }; static DEFINES sD___41 = {"_SET_CH",NULL,-1,NULL, &sD___40 }; - static DEFINES sD___42 = {"_DFSET","x,y",2,"Set( _SET_DATEFORMAT, if(__SetCentury(), x, y) )", &sD___41 }; + static DEFINES sD___42 = {"_DFSET","\001x,\001y",2,"Set( _SET_DATEFORMAT, if(__SetCentury(), \001x, \001y) )", &sD___41 }; static DEFINES sD___43 = {"_SET_VIDEOMODE",NULL,-1,"40", &sD___42 }; static DEFINES sD___44 = {"_SET_MBLOCKSIZE",NULL,-1,"41", &sD___43 }; static DEFINES sD___45 = {"_SET_MFILEEXT",NULL,-1,"42", &sD___44 };