2007-03-12 14:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbexpra.c
    * emulate xHarbour HB_ENUMINDEX() inside FOR EACH loop when
      HB_COMPAT_XHB macro is set
      It's only for compatibility - I strongly suggest to use
            <unumvar>:__enumIndex()
      which is more flexible and allow to chose the enumerator
      variable not only the one from last loop

  * harbour/include/hbexprb.c
    * added comment removed from hbexpra.c

  * harbour/source/compiler/hbmain.c
    ! fixed GPF which can appear when -b option is used in line numbering
      inside codeblocks
This commit is contained in:
Przemyslaw Czerpak
2007-03-12 13:37:49 +00:00
parent 5325e4643b
commit 4f10cc035a
4 changed files with 44 additions and 3 deletions

View File

@@ -8,6 +8,22 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-03-12 14:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexpra.c
* emulate xHarbour HB_ENUMINDEX() inside FOR EACH loop when
HB_COMPAT_XHB macro is set
It's only for compatibility - I strongly suggest to use
<unumvar>:__enumIndex()
which is more flexible and allow to chose the enumerator
variable not only the one from last loop
* harbour/include/hbexprb.c
* added comment removed from hbexpra.c
* harbour/source/compiler/hbmain.c
! fixed GPF which can appear when -b option is used in line numbering
inside codeblocks
2007-03-11 11:00 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/main/Makefile
* Changed order of linked libraries for linkers with linear library

View File

@@ -135,7 +135,29 @@ HB_EXPR_PTR hb_compExprNewFunCall( HB_EXPR_PTR pName, HB_EXPR_PTR pParms, HB_COM
iCount = ( int ) hb_compExprParamListLen( pParms );
/* TODO: EMPTY() (not done by Clipper) */
if( iCount && strcmp( "EVAL", pName->value.asSymbol ) == 0 )
if( iCount == 0 )
{
#if !defined( HB_MACRO_SUPPORT ) && defined( HB_COMPAT_XHB )
if( strcmp( "HB_ENUMINDEX", pName->value.asSymbol ) == 0 )
{
HB_ENUMERATOR_PTR pEnumVar;
pEnumVar = HB_COMP_PARAM->functions.pLast->pEnum;
if( pEnumVar )
{
while( pEnumVar->pNext )
pEnumVar = pEnumVar->pNext;
HB_COMP_EXPR_DELETE( pParms );
HB_COMP_EXPR_DELETE( pName );
return hb_compExprNewMethodCall( hb_compExprNewSend(
hb_compExprNewVar( pEnumVar->szName, HB_COMP_PARAM ),
"__ENUMINDEX", NULL, HB_COMP_PARAM ), NULL );
}
}
#endif
}
/* TODO: EMPTY() (not done by Clipper) */
else if( strcmp( "EVAL", pName->value.asSymbol ) == 0 )
{
HB_EXPR_PTR pEval;
/* Optimize Eval( bBlock, [ArgList] ) to: bBlock:Eval( [ArgList] ) */
@@ -153,7 +175,7 @@ HB_EXPR_PTR hb_compExprNewFunCall( HB_EXPR_PTR pName, HB_EXPR_PTR pParms, HB_COM
HB_COMP_EXPR_DELETE( pName );
return pEval;
}
else if( iCount && strcmp( "_GET_", pName->value.asSymbol ) == 0 )
else if( strcmp( "_GET_", pName->value.asSymbol ) == 0 )
{
/* Reserved Clipper function used to handle GET variables
*/

View File

@@ -1434,6 +1434,7 @@ static HB_EXPR_FUNC( hb_compExprUseFunCall )
if( hb_compFunCallCheck( HB_COMP_PARAM, pName->value.asSymbol, usCount ) )
#endif
{
/* TODO: EMPTY() (not done by Clipper) */
if( ( strcmp( "AT", pName->value.asSymbol ) == 0 ) && usCount == 2 )
{
hb_compExprReduceAT( pSelf, HB_COMP_PARAM );

View File

@@ -2362,7 +2362,8 @@ void hb_compLinePush( HB_COMP_DECL ) /* generates the pcode with the currently c
if( HB_COMP_PARAM->currLine != HB_COMP_PARAM->lastLine )
{
if( HB_COMP_PARAM->functions.pLast->pCode[ HB_COMP_PARAM->lastLinePos ] == HB_P_LINE &&
if( HB_COMP_PARAM->lastLinePos < HB_COMP_PARAM->functions.pLast->lPCodePos &&
HB_COMP_PARAM->functions.pLast->pCode[ HB_COMP_PARAM->lastLinePos ] == HB_P_LINE &&
HB_COMP_PARAM->functions.pLast->lPCodePos - HB_COMP_PARAM->lastLinePos == 3 )
{
HB_COMP_PARAM->functions.pLast->pCode[ HB_COMP_PARAM->lastLinePos + 1 ] = HB_LOBYTE( HB_COMP_PARAM->currLine );
@@ -4048,6 +4049,7 @@ void hb_compCodeBlockStart( HB_COMP_DECL, BOOL bLateEval )
pBlock->bLateEval = bLateEval;
HB_COMP_PARAM->functions.pLast = pBlock;
HB_COMP_PARAM->lastLinePos = 0;
}
void hb_compCodeBlockEnd( HB_COMP_DECL )