From 18099d63640aa10bdddeddae4e7ec6711d0e9dab Mon Sep 17 00:00:00 2001 From: Patrick Mast Date: Mon, 25 Jun 2001 12:53:52 +0000 Subject: [PATCH] * contrib/tprepro/tprepro.prg * Bug fix in TranslateFile() method --- harbour/ChangeLog | 4 ++++ harbour/contrib/tprepro/tprepro.prg | 29 ++++++++++++----------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 6a4b2b1d43..0b54b76ca6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +2001-06-25 14:51 GMT+1 Patrick Mast + * contrib/tprepro/tprepro.prg + * Bug fix in TranslateFile() method + 2001-06-24 23:43 GMT -3 Luiz Rafael Culik *utils/hbmake/hbmake.prg * Reverted last change to hbmake, and put the file existence test on the correct place diff --git a/harbour/contrib/tprepro/tprepro.prg b/harbour/contrib/tprepro/tprepro.prg index bfda7a75bc..43a5bf5d02 100644 --- a/harbour/contrib/tprepro/tprepro.prg +++ b/harbour/contrib/tprepro/tprepro.prg @@ -74,13 +74,12 @@ RETURN NIL CLASS TPreProcessor - DATA cIncludePath,cPreProcesses + DATA cIncludePath,cPreProcessed METHOD New( cIncludePath ) METHOD End() METHOD AddRule( cRule ) - METHOD AddIncludepath( cIncludePath ) METHOD SetIncludepath( cIncludePath ) METHOD TranslateLine( cCode ) METHOD TranslateFile( cFile, lWritePPO ) @@ -96,7 +95,8 @@ METHOD New( cIncludePath ) CLASS TPreprocessor __PP_Init( cIncludePath ) - ::cIncludepath:=cIncludePath + ::cIncludepath := cIncludePath + ::cPreProcessed := "" return Self @@ -113,7 +113,7 @@ return Self METHOD SetIncludepath( cIncludePath ) CLASS TPreprocessor - __PP_PATH( cIncludePath, .t. ) + __PP_Init( cIncludePath ) ::cIncludepath:=cIncludePath @@ -122,17 +122,6 @@ return Self -METHOD AddIncludepath( cIncludePath ) CLASS TPreprocessor - - __PP_PATH( cIncludePath, .f. ) - - ::cIncludepath:=::cIncludePath+";"+cIncludePath - -return Self - - - - METHOD AddRule( cRule ) CLASS TPreprocessor @@ -217,10 +206,14 @@ METHOD TranslateFile( cFile, lWritePPO, cPPOExt, lWasteNoSpace ) CLASS TPreproce if lWasteNoSpace if !Empty( cPP ) - cResult+= LTrim( cPP ) + Replicate(CRLF,nPuntComma) + cResult+= LTrim( cPP ) endif else - cResult+=cPP + Replicate(CRLF,nPuntComma) + if Empty( cPP ) + cResult+= Replicate(CRLF,nPuntComma) + else + cResult+=cPP + Replicate(CRLF,nPuntComma) + endif endif enddo @@ -246,4 +239,6 @@ METHOD TranslateFile( cFile, lWritePPO, cPPOExt, lWasteNoSpace ) CLASS TPreproce endif + ::cPreProcessed := cResult + return cResult \ No newline at end of file