From 1f3307d61cb96a28d75451ccd045f735b2175a3f Mon Sep 17 00:00:00 2001 From: Ron Pinkas Date: Tue, 10 Jul 2001 05:02:50 +0000 Subject: [PATCH] =?UTF-8?q?2001-07-09=2022:00=20UTC-0800=20Ron=20Pinkas=20?= =?UTF-8?q?=20=20=20=20*=20contrib/dot/pp.prg=20=20?= =?UTF-8?q?=20=20=20=20*=20Changed=20PP=5FMain()=20to=20STATIC=20Main()=20?= =?UTF-8?q?to=20have=20a=20Main=20procedure=20for=20build=20that=20require?= =?UTF-8?q?=20a=20MAIN=20yet=20avoid=20conflict=20if=20linked=20with=20a?= =?UTF-8?q?=20prg=20including=20a=20MAIN.=20=20=20=20*=20contrib/dot/pp=5F?= =?UTF-8?q?harb.ch=20=20=20=20=20=20*=20Wrapped=20a=20Windows=20specific?= =?UTF-8?q?=20code=20within=20#ifdef=20WIN.=20=20=20=20/*=20Thanks=20to=20?= =?UTF-8?q?input=20from=20Toma=C2=9E=20Zupan.=20*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * source/pp/ppcore.c ! Added a BOOL 2nd parameter to isExpres() to flag a LIST MP. This fixes problem with matching a list exp with an empty component. --- harbour/ChangeLog | 14 +++++++-- harbour/contrib/dot/pp.prg | 2 +- harbour/contrib/dot/pp_harb.ch | 55 ++++++++++++++++++++++++++++------ harbour/source/pp/ppcore.c | 8 ++--- 4 files changed, 63 insertions(+), 16 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8687c30067..dba42d6ff2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,13 @@ +2001-07-09 22:00 UTC-0800 Ron Pinkas + * contrib/dot/pp.prg + * Changed PP_Main() to STATIC Main() to have a Main procedure for build that require a MAIN yet avoid conflict if linked with a prg including a MAIN. + * contrib/dot/pp_harb.ch + * Wrapped a Windows specific code within #ifdef WIN. + /* Thanks to input from Tomaž Zupan. */ + + * source/pp/ppcore.c + ! Added a BOOL 2nd parameter to isExpres() to flag a LIST MP. This fixes problem with matching a list exp with an empty component. + 2001-07-10 01:15 UTC+1 JFL (mafact) * harbour/source/vm/Classe.c - Hb_ClsScope() Remed :-(((((((((( @@ -9,9 +19,9 @@ - Hb_ClsScope() Corrected and re-added - hb_getRrealclsName() enhanced to keep a better trace of Class tree - __ClsInst simplified - - List of modifs simplified + - List of modifs simplified * harbour/include/Hbclass.ch - - List of modifs simplified + - List of modifs simplified - Added a line of explanation for HB_CLS_ENFORCERO * harbour/utils/hbmake/hbmake.prg - added #ifndef __HARBOUR__ around Function HB_OSNEWLINE() diff --git a/harbour/contrib/dot/pp.prg b/harbour/contrib/dot/pp.prg index 18cac7fccb..b19676fc4f 100644 --- a/harbour/contrib/dot/pp.prg +++ b/harbour/contrib/dot/pp.prg @@ -199,7 +199,7 @@ static s_lRunLoaded := .F., s_lClsLoaded := .F., s_lFWLoaded := .F. //--------------------------------------------------------------// -PROCEDURE PP_Main( sSource, p1, p2, p3, p4, p5, p6, p7, p8, p9 ) +STATIC PROCEDURE Main( sSource, p1, p2, p3, p4, p5, p6, p7, p8, p9 ) LOCAL sIncludePath, nNext, sPath, sSwitch := "" LOCAL nAt, sParams, sPPOExt, aParams diff --git a/harbour/contrib/dot/pp_harb.ch b/harbour/contrib/dot/pp_harb.ch index 4d96445eca..e9b0af86f2 100644 --- a/harbour/contrib/dot/pp_harb.ch +++ b/harbour/contrib/dot/pp_harb.ch @@ -1,9 +1,31 @@ -//--------------------------------------------------------------// +/* + * Harbour Project source code: + * Pre-Processor/Dot prompt environment + * + * Copyright 2000 Ron Pinkas + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + */ #ifdef __HARBOUR__ #include "hbclass.ch" +//----------------------------------------------------------------------------// CLASS TInterpreter DATA cText @@ -29,6 +51,7 @@ CLASS TInterpreter METHOD LoadFiveWin() INLINE PP_LoadFw() ENDCLASS +//----------------------------------------------------------------------------// METHOD Run( p1, p2, p3, p4, p5, p6, p7, p8, p9 ) LOCAL aParams := HB_aParams(), xRet @@ -43,6 +66,7 @@ METHOD Run( p1, p2, p3, p4, p5, p6, p7, p8, p9 ) RETURN xRet +//----------------------------------------------------------------------------// METHOD Compile() LOCAL nLine, nLines, nProcId := 0 @@ -68,6 +92,7 @@ METHOD Compile() RETURN nProcId > 0 +//----------------------------------------------------------------------------// #pragma BEGINDUMP #include @@ -81,6 +106,7 @@ RETURN nProcId > 0 static BOOL s_bArrayPrefix = FALSE; +//----------------------------------------------------------------------------// static HB_FUNC( SETARRAYPREFIX ) { PHB_ITEM pbArrayPrefix = hb_param( 1, HB_IT_LOGICAL ); @@ -91,6 +117,7 @@ static HB_FUNC( SETARRAYPREFIX ) } } +//----------------------------------------------------------------------------// static HB_FUNC( NEXTTOKEN ) { PHB_ITEM pLine = hb_param( 1, HB_IT_STRING ); @@ -425,6 +452,7 @@ static HB_FUNC( NEXTTOKEN ) hb_retclen( sReturn, nLen ); } +//----------------------------------------------------------------------------// static HB_FUNC( NEXTIDENTIFIER ) { PHB_ITEM pLine = hb_param( 1, HB_IT_STRING ); @@ -567,16 +595,25 @@ static HB_FUNC( NEXTIDENTIFIER ) } } -//----------------------------------------------------------------------------// -#include - -HB_FUNC( MESSAGEBOX ) -{ - hb_retni( MessageBox( ( HWND ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parni( 4 ) ) ); -} - #pragma STOPDUMP +//----------------------------------------------------------------------------// +#ifdef WIN + + #pragma BEGINDUMP + + #include + + HB_FUNC( MESSAGEBOX ) + { + hb_retni( MessageBox( ( HWND ) hb_parnl( 1 ), hb_parc( 2 ), hb_parc( 3 ), hb_parni( 4 ) ) ); + } + + #pragma STOPDUMP + +#endif + +//----------------------------------------------------------------------------// STATIC FUNCTION InitFWRules() /* Defines */ diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 21092f3ae4..8dc161f35c 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -111,7 +111,7 @@ static int CommandStuff( char *, char *, char *, int *, BOOL, BOOL ); static int RemoveSlash( char * ); static int WorkMarkers( char **, char **, char *, int *, BOOL ); static int getExpReal( char *, char **, BOOL, int, BOOL ); -static BOOL isExpres( char * ); +static BOOL isExpres( char *, BOOL ); static BOOL TestOptional( char *, char * ); static BOOL CheckOptional( char *, char *, char *, int *, BOOL, BOOL ); static void SkipOptional( char ** ); @@ -1805,7 +1805,7 @@ static int WorkMarkers( char ** ptrmp, char ** ptri, char * ptro, int * lenres, *ptri += lenreal; } } - else if( isExpres( expreal ) ) + else if( isExpres( expreal, *(exppatt+2) == '1' ) ) { /* printf( "Accepted: >%s<\n", expreal ); @@ -2385,7 +2385,7 @@ static int getExpReal( char * expreal, char ** ptri, BOOL prlist, int maxrez, BO return lens; } -static BOOL isExpres( char * stroka ) +static BOOL isExpres( char * stroka, BOOL prlist ) { int l1,l2; @@ -2396,7 +2396,7 @@ static BOOL isExpres( char * stroka ) #endif l1 = strlen( stroka ); - l2 = getExpReal( NULL, &stroka, FALSE, HB_PP_STR_SIZE, TRUE ); + l2 = getExpReal( NULL, &stroka, prlist, HB_PP_STR_SIZE, TRUE ); #if 0 printf( "Len1: %i Len2: %i RealExp: >%s< Last: %c\n", l1, l2, stroka - l2, ( stroka - l2 )[l1-1] );