ChangeLog 2003-10-20 13:45 UTC+0100 Ryszard Glab
This commit is contained in:
@@ -380,7 +380,7 @@ HB_EXPR_PTR hb_compExprNewFunCall( HB_EXPR_PTR pName, HB_EXPR_PTR pParms )
|
||||
/* Search for {|| &(cMacro) }. */
|
||||
else if( pElem->ExprType == HB_ET_CODEBLOCK )
|
||||
{
|
||||
HB_EXPR_PTR pBlock = pElem->value.asList.pExprList;
|
||||
HB_EXPR_PTR pBlock = pElem->value.asCodeblock.pExprList;
|
||||
|
||||
/* Search for macros {|| &cMacro }. */
|
||||
if( pBlock->ExprType == HB_ET_MACRO )
|
||||
|
||||
@@ -177,8 +177,10 @@ static HB_EXPR_FUNC( hb_compExprUseNegate );
|
||||
static void hb_compExprCodeblockPush( HB_EXPR_PTR, HB_MACRO_DECL );
|
||||
#else
|
||||
static void hb_compExprCodeblockPush( HB_EXPR_PTR );
|
||||
#if !defined(SIMPLEX)
|
||||
static void hb_compExprCodeblockEarly( HB_EXPR_PTR );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
HB_EXPR_FUNC_PTR hb_comp_ExprTable[] = {
|
||||
hb_compExprUseDummy,
|
||||
@@ -347,13 +349,21 @@ static HB_EXPR_FUNC( hb_compExprUseString )
|
||||
case HB_EA_PUSH_PCODE:
|
||||
{
|
||||
char *szDupl;
|
||||
BOOL bUseTextSubst;
|
||||
BOOL bValidMacro;
|
||||
|
||||
szDupl = hb_strupr( hb_strdup( pSelf->value.asString.string ) );
|
||||
HB_EXPR_PCODE2( hb_compGenPushString, pSelf->value.asString.string, pSelf->ulLength + 1 );
|
||||
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_MACROTEXT );
|
||||
if( ! hb_compExprIsValidMacro( szDupl ) )
|
||||
hb_compErrorMacro( pSelf->value.asString.string );
|
||||
|
||||
bValidMacro = hb_compExprIsValidMacro( szDupl, &bUseTextSubst );
|
||||
if( bUseTextSubst )
|
||||
{
|
||||
if( bValidMacro )
|
||||
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_MACROTEXT );
|
||||
else
|
||||
hb_compErrorMacro( pSelf->value.asString.string );
|
||||
}
|
||||
hb_xfree( szDupl );
|
||||
|
||||
}
|
||||
break;
|
||||
case HB_EA_POP_PCODE:
|
||||
@@ -532,9 +542,10 @@ static void hb_compExprCodeblockEarly( HB_EXPR_PTR pSelf )
|
||||
*/
|
||||
HB_EXPR_PTR pNew;
|
||||
char *szDupl;
|
||||
BOOL bUseTextSubst;
|
||||
|
||||
szDupl = hb_strupr( hb_strdup( pSelf->value.asCodeblock.string ) );
|
||||
if( !hb_compExprIsValidMacro( szDupl ) )
|
||||
if( !hb_compExprIsValidMacro( szDupl, &bUseTextSubst ) )
|
||||
{
|
||||
hb_compErrorCodeblock( pSelf->value.asCodeblock.string );
|
||||
hb_compErrorMacro( pSelf->value.asCodeblock.string );
|
||||
|
||||
@@ -416,13 +416,14 @@ ULONG hb_compExprReduceList( HB_EXPR_PTR pExpr )
|
||||
return ulCnt;
|
||||
}
|
||||
|
||||
BOOL hb_compExprIsValidMacro( char * szText )
|
||||
BOOL hb_compExprIsValidMacro( char * szText, BOOL *pbUseTextSubst )
|
||||
{
|
||||
char * pTmp = szText;
|
||||
BOOL bTextSubst;
|
||||
BOOL bMacroText = TRUE;
|
||||
|
||||
while( (( pTmp = strchr( pTmp, '&' ) ) != NULL) && bMacroText )
|
||||
*pbUseTextSubst = FALSE; /* no valid macro expression */
|
||||
while( ((pTmp = strchr( pTmp, '&' )) != NULL) && bMacroText )
|
||||
{
|
||||
/* Check if macro operator is used inside a string
|
||||
* Macro operator is ignored if it is the last char or
|
||||
@@ -464,6 +465,7 @@ BOOL hb_compExprIsValidMacro( char * szText )
|
||||
*pTmp = cSave;
|
||||
#endif
|
||||
}
|
||||
*pbUseTextSubst |= bTextSubst;
|
||||
}
|
||||
|
||||
return bMacroText;
|
||||
|
||||
@@ -309,11 +309,7 @@ HB_EXPR_PTR hb_compExprNewLong( LONG );
|
||||
HB_EXPR_PTR hb_compExprNewString( char * );
|
||||
HB_EXPR_PTR hb_compExprNewLogical( int );
|
||||
HB_EXPR_PTR hb_compExprNewSelf( void );
|
||||
#if defined(SIMPLEX)
|
||||
HB_EXPR_PTR hb_compExprNewCodeBlock( void );
|
||||
#else
|
||||
HB_EXPR_PTR hb_compExprNewCodeBlock( char *, BOOL, BOOL );
|
||||
#endif
|
||||
HB_EXPR_PTR hb_compExprNewArray( HB_EXPR_PTR );
|
||||
HB_EXPR_PTR hb_compExprNewVar( char * );
|
||||
HB_EXPR_PTR hb_compExprNewAliasVar( HB_EXPR_PTR, HB_EXPR_PTR );
|
||||
@@ -375,7 +371,7 @@ int hb_compExprType( HB_EXPR_PTR );
|
||||
void hb_compExprFree( HB_EXPR_PTR, HB_MACRO_DECL );
|
||||
void hb_compExprErrorType( HB_EXPR_PTR, HB_MACRO_DECL );
|
||||
HB_EXPR_PTR hb_compExprListStrip( HB_EXPR_PTR, HB_MACRO_DECL );
|
||||
BOOL hb_compExprIsValidMacro( char * );
|
||||
BOOL hb_compExprIsValidMacro( char *, BOOL * );
|
||||
void hb_compExprCBVarDel( HB_CBVAR_PTR );
|
||||
HB_EXPR_PTR hb_compExprReducePlusStrings( HB_EXPR_PTR, HB_EXPR_PTR, HB_MACRO_DECL );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user