From f3259b2cabed3d254b76a5812481aa5467c1bea1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 26 Jan 2011 22:56:48 +0000 Subject: [PATCH] 2011-01-26 23:56 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbpp.h * harbour/src/pp/ppcore.c ! added resetting some internal PP states in hb_pp_reset() --- harbour/ChangeLog | 5 +++++ harbour/include/hbpp.h | 7 ++++--- harbour/src/pp/ppcore.c | 18 ++++++++++++------ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f6c811dfb0..3cce692db2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-01-26 23:56 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbpp.h + * harbour/src/pp/ppcore.c + ! added resetting some internal PP states in hb_pp_reset() + 2011-01-26 23:22 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbnetio/utils/netiosrv/netiocui.prg + Shows server address in prompt when connected. diff --git a/harbour/include/hbpp.h b/harbour/include/hbpp.h index 18f85e6cd8..09eae5d589 100644 --- a/harbour/include/hbpp.h +++ b/harbour/include/hbpp.h @@ -583,8 +583,8 @@ typedef struct int iLineTot; /* total number of parsed lines */ int iCycle; /* translation counter */ - int iMaxCycles; /* maximum number of translations */ - int iHideStrings; /* hidden string mode */ + int iMaxCycles; /* maximum number of translations (current) */ + int iMaxCyclesSet; /* maximum number of translations (default) */ HB_BOOL fTracePragmas; /* display information about set pragmas */ HB_BOOL fWritePreprocesed; /* write preprocessed data to file (.ppo) */ HB_BOOL fWriteTrace; /* write translation to file (.ppt) */ @@ -596,7 +596,8 @@ typedef struct char * szTraceFileName; /* trace output file name */ FILE * file_trace; /* trace output file handle */ - HB_BOOL fQuiet; /* do not show standard information */ + HB_BOOL fQuietSet; /* do not show standard information (default) */ + HB_BOOL fQuiet; /* do not show standard information (current) */ HB_BOOL fEscStr; /* use \ in strings as escape character */ HB_BOOL fError; /* indicates error in last operation */ int iErrors; /* number of error during preprocessing */ diff --git a/harbour/src/pp/ppcore.c b/harbour/src/pp/ppcore.c index e10ec1f911..5014f486b2 100644 --- a/harbour/src/pp/ppcore.c +++ b/harbour/src/pp/ppcore.c @@ -2679,9 +2679,9 @@ static void hb_pp_pragmaNew( PHB_PP_STATE pState, PHB_PP_TOKEN pToken ) /* xHarbour extension */ else if( hb_pp_tokenValueCmp( pToken, "TEXTHIDDEN", HB_PP_CMP_DBASE ) ) { - pValue = hb_pp_pragmaGetInt( pToken->pNext, &pState->iHideStrings ); + pValue = hb_pp_pragmaGetInt( pToken->pNext, &iValue ); if( pValue ) - fError = hb_pp_setCompilerSwitch( pState, pToken->value, pState->iHideStrings ); + fError = hb_pp_setCompilerSwitch( pState, pToken->value, iValue ); else fError = HB_TRUE; } @@ -5499,8 +5499,8 @@ void hb_pp_init( PHB_PP_STATE pState, HB_BOOL fQuiet, int iCycles, void * cargo, PHB_PP_DUMP_FUNC pDumpFunc, PHB_PP_INLINE_FUNC pInLineFunc, PHB_PP_SWITCH_FUNC pSwitchFunc ) { - pState->fQuiet = fQuiet; - pState->iMaxCycles = ( iCycles > 0 ) ? iCycles : HB_PP_MAX_CYCLES; + pState->fQuiet = pState->fQuietSet = fQuiet; + pState->iMaxCycles = pState->iMaxCyclesSet = ( iCycles > 0 ) ? iCycles : HB_PP_MAX_CYCLES; pState->cargo = cargo; pState->pOpenFunc = pOpenFunc; pState->pCloseFunc = pCloseFunc; @@ -5522,8 +5522,14 @@ void hb_pp_setIncFunc( PHB_PP_STATE pState, PHB_PP_INC_FUNC pIncFunc ) */ void hb_pp_reset( PHB_PP_STATE pState ) { - pState->fError = HB_FALSE; - pState->iErrors = 0; + pState->fError = HB_FALSE; + pState->iErrors = 0; + pState->iLineTot = 0; + pState->fEscStr = HB_FALSE; + pState->fTracePragmas = HB_FALSE; + pState->fQuiet = pState->fQuietSet; + pState->iMaxCycles = pState->iMaxCyclesSet; + pState->iStreamDump = HB_PP_STREAM_OFF; hb_pp_InFileFree( pState ); hb_pp_OutFileFree( pState );