From 5744e86ad26b98cfa718a0e02788dccfc36600c5 Mon Sep 17 00:00:00 2001 From: Ryszard Glab Date: Thu, 23 Oct 2003 14:09:30 +0000 Subject: [PATCH] Changelog 2003-10-23 15:40 UTC+0100 Ryszard Glab --- harbour/ChangeLog | 4 +++ harbour/source/compiler/harbour.l | 56 ++++++++++++------------------- 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 098ce24406..bcba1fe9fa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,10 @@ 2002-12-01 23:12 UTC+0100 Foo Bar */ +2003-10-23 15:40 UTC+0100 Ryszard Glab + * source/compiler/harbour.l + * fixed codeblock scanning - this should cure random GPFs + 2003-10-23 11:00 UTC+0100 Ryszard Glab * include/hbexprc.c * source/compiler/exproptc.c diff --git a/harbour/source/compiler/harbour.l b/harbour/source/compiler/harbour.l index e88b850571..a5eed108e5 100644 --- a/harbour/source/compiler/harbour.l +++ b/harbour/source/compiler/harbour.l @@ -1459,49 +1459,37 @@ Separator {SpaceTab} yylval.asCodeblock.lateEval = FALSE; cText = yytext+1; iLen = 1; - while( *cText || ((cMark != '\0') && (*cText == '\0')) ) + + while( *cText || iLen < yyleng ) { iLen++; - if( *cText == '\'' ) - { - if( cMark == '\'' ) - cMark = '\0'; - else if( cMark == '\0' ) - cMark = '\''; - } - else if( *cText == '"' ) - { - if( cMark == '"' ) - cMark = '\0'; - else if( cMark == '\0' ) - cMark = '"'; - } - else if( *cText == '[' ) - { - if( cMark == ']' ) - cMark = '\0'; - else if( cMark == '\0' ) - cMark = ']'; - } + if( *cText == '\'' && cMark == '\0' ) + cMark = '\''; + else if( *cText == '"' && cMark == '\0' ) + cMark = '"'; + else if( *cText == '[' && cMark == '\0' ) + cMark = ']'; + else if( *cText == cMark ) + cMark = '\0'; else if( *cText == '|' && iPos == 0 ) - iPos = iLen; + iPos = iLen; else if( *cText == '&' && cMark == '\0' ) { - yylval.asCodeblock.isMacro = TRUE; - ++cText; - while( *cText == ' ' || *cText == '\t' ) - ++cText; - if( *cText == '(' ) - yylval.asCodeblock.lateEval = TRUE; - --cText; + yylval.asCodeblock.isMacro = TRUE; + ++cText; + while( *cText == ' ' || *cText == '\t' ) + ++cText; + if( *cText == '(' ) + yylval.asCodeblock.lateEval = TRUE; + --cText; } else if( *cText == '{' && cMark == '\0' ) - iCode++; + iCode++; else if( *cText == '}' && cMark == '\0' ) { - iCode--; - if( iCode == 0 ) - break; + iCode--; + if( iCode == 0 ) + break; } cText++; }