ChangeLog 2001-07-22 20:15 UTC+0100
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
2001-07-22 20:15 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*include/hbapi.h
|
||||
*include/hbexprb.c
|
||||
*source/vm/hvm.c
|
||||
*source/vm/macro.c
|
||||
*source/compiler/exproptb.c
|
||||
*source/macro/macrob.c
|
||||
* fixed to support nested aliases in macro, eg.
|
||||
LOCAL cAlias
|
||||
cAlias := "&area"
|
||||
PRIVATE area
|
||||
area := "MyAlias"
|
||||
? &cAlias->someFile
|
||||
? &cAlias->( someExpr )
|
||||
|
||||
2001-07-22 08:40 GMT -3 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
*source/rtl/getsys.prg
|
||||
*Now if an get has an message it will display properly
|
||||
|
||||
@@ -539,6 +539,7 @@ extern BOOL hb_macroIsIdent( char * szString ); /* determine if a string is a
|
||||
extern void hb_macroPopAliasedValue( HB_ITEM_PTR pAlias, HB_ITEM_PTR pVar ); /* compiles and evaluates an aliased macro expression */
|
||||
extern void hb_macroPushAliasedValue( HB_ITEM_PTR pAlias, HB_ITEM_PTR pVar ); /* compiles and evaluates an aliased macro expression */
|
||||
extern char * hb_macroGetType( HB_ITEM_PTR pItem ); /* determine the type of an expression */
|
||||
extern char * hb_macroExpandString( char *szString, ULONG ulLength, BOOL *pbNewString ); /* expands valid '&' operator */
|
||||
|
||||
/* garbage collector */
|
||||
#define HB_GARBAGE_FUNC( hbfunc ) void hbfunc( void * Cargo ) /* callback function for cleaning garbage memory pointer */
|
||||
|
||||
@@ -1062,11 +1062,13 @@ static HB_EXPR_FUNC( hb_compExprUseMacro )
|
||||
case HB_EA_DELETE:
|
||||
if( pSelf->value.asMacro.pExprList )
|
||||
HB_EXPR_PCODE1( hb_compExprDelete, pSelf->value.asMacro.pExprList );
|
||||
/* NOTE: This will be released during releasing of symbols' table
|
||||
*
|
||||
* if( pSelf->value.asMacro.szMacro );
|
||||
* HB_XFREE( pSelf->value.asMacro.szMacro );
|
||||
*/
|
||||
|
||||
#if defined( HB_MACRO_SUPPORT )
|
||||
if( pSelf->value.asMacro.szMacro );
|
||||
HB_XFREE( pSelf->value.asMacro.szMacro );
|
||||
#else
|
||||
/* NOTE: This will be released during releasing of symbols' table */
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
return pSelf;
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
/* hbexprb.c is also included from ../macro/macro.c
|
||||
* However it produces a slighty different code if used in
|
||||
* macro compiler (there is an additional parameter passed to some functions)
|
||||
* 0 - ignore this magic number - this is used to force compilation
|
||||
* 1 - ignore this magic number - this is used to force compilation
|
||||
*/
|
||||
#include "hbexprb.c"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* hbexprb.c is also included from ../compiler/exproptb.c
|
||||
* However it produces a slighty different code if used in
|
||||
* macro compiler (there is an additional parameter passed to some functions)
|
||||
* 1 - ignore this magic number - this is used to force compilation
|
||||
* 2 - ignore this magic number - this is used to force compilation
|
||||
*/
|
||||
|
||||
#define HB_MACRO_SUPPORT
|
||||
|
||||
@@ -2839,8 +2839,17 @@ static ERRCODE hb_vmSelectWorkarea( PHB_ITEM pAlias )
|
||||
case HB_IT_STRING:
|
||||
/* Alias was evaluated from an expression, for example: (cVar)->field
|
||||
*/
|
||||
bSuccess = hb_rddSelectWorkAreaAlias( pAlias->item.asString.value );
|
||||
hb_itemClear( pAlias );
|
||||
{
|
||||
/* expand '&' operator if exists */
|
||||
char *cAlias;
|
||||
BOOL bNewString;
|
||||
|
||||
cAlias = hb_macroExpandString( pAlias->item.asString.value, pAlias->item.asString.length, &bNewString );
|
||||
bSuccess = hb_rddSelectWorkAreaAlias( cAlias );
|
||||
if( bNewString )
|
||||
hb_xfree( cAlias );
|
||||
hb_itemClear( pAlias );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -625,6 +625,24 @@ static void hb_macroUseAliased( HB_ITEM_PTR pAlias, HB_ITEM_PTR pVar, int iFlag
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for '&' operator and replace it with a macro variable value
|
||||
* Returns: the passed string if there is no '&' operator (pbNewString:=FALSE)
|
||||
* new string if a valid macro text substitution was found (and sets
|
||||
* pbNewString to TRUE)
|
||||
*/
|
||||
char * hb_macroExpandString( char *szString, ULONG ulLength, BOOL *pbNewString )
|
||||
{
|
||||
char *szResultString;
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_macroExpandString(%p)", pItem));
|
||||
|
||||
if( szString )
|
||||
szResultString = hb_macroTextSubst( szString, &ulLength );
|
||||
else
|
||||
szResultString = szString;
|
||||
*pbNewString = ( szString != szResultString );
|
||||
return szResultString;
|
||||
}
|
||||
|
||||
/* compile a string and return a pcode to push a value of expression
|
||||
* NOTE: it can be called to implement an index key evaluation
|
||||
* use hb_macroRun() to evaluate a compiled pcode
|
||||
|
||||
Reference in New Issue
Block a user