ChangeLog 2001-07-21 16:15 UTC+0100

This commit is contained in:
Ryszard Glab
2001-07-21 15:25:12 +00:00
parent 18b756122d
commit 4f4a73e9f9
9 changed files with 61 additions and 33 deletions

View File

@@ -1,3 +1,24 @@
2001-07-21 16:15 UTC+0100 Ryszard Glab <rglab@imid.med.pl>
*include/hbexpra.c
*include/hbexprb.c
*include/hbexprc.c
*include/hbexprop.h
*source/common/expropt1.c
*fixed support for &alias->( expression )
*removed global variables that were breaking modularity of the code
*fixed support for syntax: SomeFun( &macro + someValue )
*source/compiler/harbour.y
*removed access to internal HB_EXPR structure data
*source/rtl/checkbox.prg
* added 'LOCAL oCheck' to compile without warnings
*source/rtl/gtsln/gtsln.c
*fixed to support (at least) SLang version 1.3.8
2001-07-21 09:20 GMT -3 Luiz Rafael Culik <culik@sl.conex.net>
*source/rtl/checkbox.prg
*lowercased the include file names

View File

@@ -129,9 +129,6 @@ static BYTE s_PrecedTable[] = {
HB_ET_NIL /* HB_EO_PREDEC, pre-operators */
};
BOOL hb_exp_bArgList = FALSE;
HB_EXPR_PTR hb_exp_pSelf;
static HB_CBVAR_PTR hb_compExprCBVarNew( char *, BYTE );
/* ************************************************************************ */

View File

@@ -218,9 +218,6 @@ HB_EXPR_FUNC_PTR hb_comp_ExprTable[] = {
hb_compExprUsePreDec /* highest precedence */
};
extern BOOL hb_exp_bArgList;
extern HB_EXPR_PTR hb_exp_pSelf;
/* ************************************************************************* */
static HB_EXPR_FUNC( hb_compExprUseDummy )
@@ -1005,10 +1002,10 @@ static HB_EXPR_FUNC( hb_compExprUseMacro )
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_MACROSYMBOL );
else if( pSelf->value.asMacro.SubType != HB_ET_MACRO_ALIASED )
{
if( hb_exp_bArgList )
if( pSelf->value.asMacro.SubType & HB_ET_MACRO_ARGLIST )
{
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_MACROPUSHARG );
HB_EXPR_USE( hb_exp_pSelf->value.asFunCall.pFunName, HB_EA_PUSH_PCODE );
HB_EXPR_USE( pSelf->value.asMacro.pFunCall->value.asFunCall.pFunName, HB_EA_PUSH_PCODE );
}
else
{
@@ -1113,10 +1110,18 @@ static HB_EXPR_FUNC( hb_compExprUseFunCall )
--usCount;
if( usCount )
{
hb_exp_bArgList = TRUE;
hb_exp_pSelf = pSelf;
/* check if &macro is used as a function call argument */
HB_EXPR_PTR pExpr = pSelf->value.asFunCall.pParms->value.asList.pExprList;
while( pExpr )
{
if( pExpr->ExprType == HB_ET_MACRO )
{
pExpr->value.asMacro.SubType |= HB_ET_MACRO_ARGLIST;
pExpr->value.asMacro.pFunCall = pSelf;
}
pExpr = pExpr->pNext;
}
HB_EXPR_USE( pSelf->value.asFunCall.pParms, HB_EA_PUSH_PCODE );
hb_exp_bArgList = FALSE;
}
}
else
@@ -1147,10 +1152,19 @@ static HB_EXPR_FUNC( hb_compExprUseFunCall )
--usCount;
if( usCount )
{
hb_exp_bArgList = TRUE;
hb_exp_pSelf = pSelf;
HB_EXPR_PTR pExpr = pSelf->value.asFunCall.pParms->value.asList.pExprList;
/* check if &macro is used as a function call argument */
while( pExpr )
{
if( pExpr->ExprType == HB_ET_MACRO )
{
/* &macro was passed - handle it differently then in a normal statement */
pExpr->value.asMacro.SubType |= HB_ET_MACRO_ARGLIST;
pExpr->value.asMacro.pFunCall = pSelf;
}
pExpr = pExpr->pNext;
}
HB_EXPR_USE( pSelf->value.asFunCall.pParms, HB_EA_PUSH_PCODE );
hb_exp_bArgList = FALSE;
}
}
else
@@ -1724,17 +1738,11 @@ static HB_EXPR_FUNC( hb_compExprUseAssign )
{
/* it assigns a value and leaves it on the stack */
/* Temporarily disable HB_P_MACROPUSHARG support. */
BOOL bArg = hb_exp_bArgList; hb_exp_bArgList = FALSE;
HB_EXPR_USE( pSelf->value.asOperator.pRight, HB_EA_PUSH_PCODE );
/* QUESTION: Can we replace DUPLICATE+POP with a single PUT opcode
*/
HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_DUPLICATE );
HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_POP_PCODE );
/* Restore HB_P_MACROPUSHARG support. */
hb_exp_bArgList = bArg;
}
}
break;

View File

@@ -88,10 +88,6 @@ void hb_compExprPushOperEq( HB_EXPR_PTR pSelf, BYTE bOpEq, HB_MACRO_DECL )
void hb_compExprPushOperEq( HB_EXPR_PTR pSelf, BYTE bOpEq )
#endif
{
extern BOOL hb_exp_bArgList;
/* Temporarily disable HB_P_MACROPUSHARG support. */
BOOL bArg = hb_exp_bArgList; hb_exp_bArgList = FALSE;
/* NOTE: an object instance variable needs special handling
*/
if( pSelf->value.asOperator.pLeft->ExprType == HB_ET_SEND )
@@ -165,10 +161,6 @@ void hb_compExprPushOperEq( HB_EXPR_PTR pSelf, BYTE bOpEq )
/* pop the new value into variable and leave the copy on the stack */
HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_POP_PCODE );
}
/* Restore HB_P_MACROPUSHARG support. */
hb_exp_bArgList = bArg;
}
/* Generates pcodes for <operator>= syntax

View File

@@ -99,6 +99,7 @@ typedef enum
#define HB_ET_MACRO_SYMBOL 1 /* &fimcall() */
#define HB_ET_MACRO_ALIASED 2 /* &alias->&variable */
#define HB_ET_MACRO_EXPR 4 /* &( expr ) */
#define HB_ET_MACRO_ARGLIST 8 /* &variable used as a function call argument */
/* types of expressions
* NOTE: the order of these definition is important - change it carefully
@@ -193,6 +194,7 @@ typedef struct HB_EXPR_
unsigned char SubType; /* context in which macro is used */
char * szMacro; /* identifier after the macro operator */
struct HB_EXPR_ *pExprList; /* list elements if &(...) was used */
struct HB_EXPR_ *pFunCall; /* pointer to a function if used as function's call argument */
} asMacro;
struct
{

View File

@@ -429,6 +429,13 @@ HB_EXPR_PTR hb_compExprNewAliasExpr( HB_EXPR_PTR pAlias, HB_EXPR_PTR pExpList )
pExpr->value.asAlias.pAlias = pAlias;
pExpr->value.asAlias.pExpList = pExpList;
pExpr->value.asAlias.pVar = NULL;
if( pAlias->ExprType == HB_ET_MACRO )
{
/* Is it a special case &variable->( expressionList ) */
if( pAlias->value.asMacro.SubType == HB_ET_MACRO_VAR )
pAlias->value.asMacro.SubType = HB_ET_MACRO_ALIASED;
}
return pExpr;
}

View File

@@ -514,7 +514,7 @@ MacroVar : MACROVAR { $$ = hb_compExprNewMacro( NULL, '&', $1 ); }
| MACROTEXT { $$ = hb_compExprNewMacro( NULL, 0, $1 ); }
;
MacroVarAlias : MacroVar ALIASOP { $$ = $1; $$->value.asMacro.SubType = HB_ET_MACRO_SYMBOL; }
MacroVarAlias : MacroVar ALIASOP { $$ = $1; }
;
/* Macro expressions

View File

@@ -199,9 +199,10 @@ function __GUICOLOR( cPair, nPos )
ccolor := SubStr(ccolor, 1, nCommaPos - 1)
endif
return ccolor
function _CHECKBOX_( Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
local Local1, Local2, Local3, Local4
function _CHECKBOX_( Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)
LOCAL oCheck
oCheck := checkbox(Row(), Col(), Arg2)
if ( !( ISNIL( oCheck ) ) )
oCheck:select(Arg1)

View File

@@ -60,13 +60,13 @@
#include <slang.h>
#endif
/* missing defines in previous versions of Slang - this can not work ! */
#if SLANG_VERSION < 10400
typedef unsigned short SLsmg_Char_Type;
#define SLSMG_EXTRACT_CHAR( x ) ( ( x ) & 0xFF )
#define SLSMG_EXTRACT_COLOR( x ) ( ( ( x ) >> 8 ) & 0xFF )
#define SLSMG_BUILD_CHAR( ch, color ) ( ( ( SLsmg_Char_Type ) ( unsigned char )( ch ) ) | ( ( color ) << 8 ) )
/* missing defines in previous versions of Slang - this can not work ! */
#if SLANG_VERSION < 10308
#define SLSMG_DIAMOND_CHAR 0x04
#define SLSMG_DEGREE_CHAR 0xF8
#define SLSMG_PLMINUS_CHAR 0xF1