From 0ad31b61dfb8ffca650048b6db2a99e0b687314b Mon Sep 17 00:00:00 2001 From: "Alexander S.Kresin" Date: Sat, 31 Jul 1999 19:08:47 +0000 Subject: [PATCH] Updating preprocessor files --- harbour/ChangeLog | 4 ++++ harbour/source/hbpp/hbpp.c | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index bb0a715f6a..e1f46dcbce 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,7 @@ +19990731-22:55 Alexander Kresin + * source\hbpp\hbpp.c + * Fixed bugs mentioned by Victor Szel + 19990731-20:16 GMT+1 Antonio Linares * tests\working\debugger.prg * improved sample. diff --git a/harbour/source/hbpp/hbpp.c b/harbour/source/hbpp/hbpp.c index f7338baf99..bfd6f3ddc3 100644 --- a/harbour/source/hbpp/hbpp.c +++ b/harbour/source/hbpp/hbpp.c @@ -636,6 +636,7 @@ int ParseExpression( char* sLine, char* sOutLine ) if ( kolpass < 3 ) { ptri = sLine + isdvig; + SKIPTABSPACES( ptri ); if ( ISNAME(*ptri) ) NextName( &ptri, sToken, NULL); else @@ -1748,18 +1749,27 @@ int NextName ( char** sSource, char* sDest, char **sOut ) int NextParm ( char** sSource, char* sDest ) { - int lenName = 0, State = STATE_NORMAL; + int lenName = 0, State = STATE_NORMAL, StBr = 0; SKIPTABSPACES( (*sSource) ); while ( **sSource != '\0' ) { if ( State == STATE_QUOTE1 ) - { if ( **sSource == '\'' ) State = STATE_NORMAL; } + { + if ( **sSource == '\'' ) State = STATE_NORMAL; + } else if ( State == STATE_QUOTE2 ) - { if ( **sSource == '\"' ) State = STATE_NORMAL; } + { + if ( **sSource == '\"' ) State = STATE_NORMAL; + } else if ( **sSource == '\"' ) State = STATE_QUOTE2; else if ( **sSource == '\'' ) State = STATE_QUOTE1; - else if ( **sSource == ',' || **sSource == ')' ) break; + else if ( **sSource == '(' ) StBr++; + else if ( **sSource == ')' || **sSource == ',' ) + { + if( !StBr ) break; + if( **sSource == ')' ) StBr--; + } if ( sDest != NULL ) *sDest++ = **sSource; (*sSource)++;