2009-04-02 22:01 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexpra.c
! verify all expression POP operation for usage as LValue
* harbour/include/hbexprb.c
! fixed possible GPF in unverified send context
+ added support for IIF() usage as LValue even if it cannot be
reduced during [macro]compilation
* harbour/source/macro/macro.yyc
* harbour/source/macro/macro.y
* harbour/source/macro/macrolex.c
* removed support for some characters unsupported by Clipper in
macro expressions like chr(10) as trailing expression character, f.e.:
? &("DATE()"+chr(10))
* harbour/source/compiler/complex.c
* formatting
This commit is contained in:
@@ -8,6 +8,25 @@
|
||||
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
|
||||
*/
|
||||
|
||||
2009-04-02 22:01 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/include/hbexpra.c
|
||||
! verify all expression POP operation for usage as LValue
|
||||
|
||||
* harbour/include/hbexprb.c
|
||||
! fixed possible GPF in unverified send context
|
||||
+ added support for IIF() usage as LValue even if it cannot be
|
||||
reduced during [macro]compilation
|
||||
|
||||
* harbour/source/macro/macro.yyc
|
||||
* harbour/source/macro/macro.y
|
||||
* harbour/source/macro/macrolex.c
|
||||
* removed support for some characters unsupported by Clipper in
|
||||
macro expressions like chr(10) as trailing expression character, f.e.:
|
||||
? &("DATE()"+chr(10))
|
||||
|
||||
* harbour/source/compiler/complex.c
|
||||
* formatting
|
||||
|
||||
2009-04-02 17:21 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ Enabled embedded Harbour compiler. This will simplify
|
||||
|
||||
@@ -709,6 +709,7 @@ HB_EXPR_PTR hb_macroExprGenPop( HB_EXPR_PTR pExpr, HB_COMP_DECL )
|
||||
{
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_macroExprGenPop(%i)", pExpr->ExprType));
|
||||
|
||||
HB_EXPR_USE( pExpr, HB_EA_LVALUE );
|
||||
return HB_EXPR_USE( pExpr, HB_EA_POP_PCODE );
|
||||
}
|
||||
|
||||
@@ -732,6 +733,7 @@ HB_EXPR_PTR hb_compExprGenPop( HB_EXPR_PTR pExpr, HB_COMP_DECL )
|
||||
{
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_compExprGenPop(%i)", pExpr->ExprType));
|
||||
|
||||
HB_EXPR_USE( pExpr, HB_EA_LVALUE );
|
||||
return HB_EXPR_USE( pExpr, HB_EA_POP_PCODE );
|
||||
}
|
||||
|
||||
|
||||
@@ -460,6 +460,7 @@ static HB_EXPR_FUNC( hb_compExprUseCodeblock )
|
||||
break;
|
||||
}
|
||||
case HB_EA_POP_PCODE:
|
||||
break;
|
||||
case HB_EA_PUSH_POP:
|
||||
case HB_EA_STATEMENT:
|
||||
hb_compWarnMeaningless( HB_COMP_PARAM, pSelf );
|
||||
@@ -851,7 +852,7 @@ static HB_EXPR_FUNC( hb_compExprUseRef )
|
||||
hb_compErrorRefer( HB_COMP_PARAM, NULL, hb_compExprDescription( pExp ) );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case HB_EA_POP_PCODE:
|
||||
break;
|
||||
case HB_EA_PUSH_POP:
|
||||
@@ -880,7 +881,14 @@ static HB_EXPR_FUNC( hb_compExprUseIIF )
|
||||
break;
|
||||
|
||||
case HB_EA_LVALUE:
|
||||
hb_compErrorLValue( HB_COMP_PARAM, pSelf );
|
||||
if( HB_SUPPORT_HARBOUR )
|
||||
{
|
||||
HB_EXPR_PTR pExpr = pSelf->value.asList.pExprList->pNext;
|
||||
HB_EXPR_USE( pExpr, HB_EA_LVALUE );
|
||||
HB_EXPR_USE( pExpr->pNext, HB_EA_LVALUE );
|
||||
}
|
||||
else
|
||||
hb_compErrorLValue( HB_COMP_PARAM, pSelf );
|
||||
break;
|
||||
|
||||
case HB_EA_PUSH_PCODE:
|
||||
@@ -904,7 +912,25 @@ static HB_EXPR_FUNC( hb_compExprUseIIF )
|
||||
break;
|
||||
}
|
||||
case HB_EA_POP_PCODE:
|
||||
{
|
||||
/* this is called if all three parts of IIF expression should be generated
|
||||
*/
|
||||
LONG lPosFalse, lPosEnd;
|
||||
HB_EXPR_PTR pExpr = pSelf->value.asList.pExprList;
|
||||
|
||||
HB_EXPR_USE( pExpr, HB_EA_PUSH_PCODE );
|
||||
lPosFalse = HB_GEN_FUNC1( JumpFalse, 0 );
|
||||
pExpr =pExpr->pNext;
|
||||
|
||||
HB_EXPR_USE( pExpr, HB_EA_POP_PCODE );
|
||||
lPosEnd = HB_GEN_FUNC1( Jump, 0 );
|
||||
pExpr =pExpr->pNext;
|
||||
|
||||
HB_GEN_FUNC1( JumpHere, lPosFalse );
|
||||
HB_EXPR_USE( pExpr, HB_EA_POP_PCODE );
|
||||
HB_GEN_FUNC1( JumpHere, lPosEnd );
|
||||
break;
|
||||
}
|
||||
|
||||
case HB_EA_PUSH_POP:
|
||||
case HB_EA_STATEMENT:
|
||||
@@ -2493,7 +2519,10 @@ static HB_EXPR_FUNC( hb_compExprUseSend )
|
||||
|
||||
case HB_EA_POP_PCODE:
|
||||
hb_compExprPushSendPop( pSelf, HB_COMP_PARAM );
|
||||
HB_EXPR_USE( pSelf->value.asMessage.pParms, HB_EA_PUSH_PCODE );
|
||||
if( pSelf->value.asMessage.pParms )
|
||||
HB_EXPR_USE( pSelf->value.asMessage.pParms, HB_EA_PUSH_PCODE );
|
||||
else
|
||||
HB_COMP_ERROR_SYNTAX( pSelf );
|
||||
HB_GEN_FUNC2( PCode2, HB_P_SENDSHORT, 1 );
|
||||
break;
|
||||
|
||||
|
||||
@@ -1225,7 +1225,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
}
|
||||
else
|
||||
pLex->iState = IIF;
|
||||
|
||||
|
||||
return pLex->iState;
|
||||
}
|
||||
else if( HB_PP_LEX_NEEDLEFT( pToken->pNext ) || pLex->iState != LOOKUP )
|
||||
|
||||
@@ -245,16 +245,7 @@ static void hb_macroIdentNew( HB_COMP_DECL, char * );
|
||||
|
||||
%%
|
||||
|
||||
Main : Expression '\n' {
|
||||
HB_MACRO_DATA->exprType = hb_compExprType( $1 );
|
||||
if( HB_MACRO_DATA->Flags & HB_MACRO_GEN_PUSH )
|
||||
hb_macroExprGenPush( $1, HB_COMP_PARAM );
|
||||
else
|
||||
hb_macroExprGenPop( $1, HB_COMP_PARAM );
|
||||
hb_macroGenPCode1( HB_P_ENDPROC, HB_COMP_PARAM );
|
||||
}
|
||||
|
||||
| Expression {
|
||||
Main : Expression {
|
||||
HB_MACRO_DATA->exprType = hb_compExprType( $1 );
|
||||
if( HB_MACRO_DATA->Flags & HB_MACRO_GEN_PUSH )
|
||||
hb_macroExprGenPush( $1, HB_COMP_PARAM );
|
||||
@@ -267,14 +258,9 @@ Main : Expression '\n' {
|
||||
if( HB_MACRO_DATA->Flags & HB_MACRO_GEN_PUSH )
|
||||
hb_macroExprGenPush( $1, HB_COMP_PARAM );
|
||||
else
|
||||
hb_macroExprGenPop( $1, HB_COMP_PARAM );
|
||||
hb_macroError( EG_SYNTAX, HB_COMP_PARAM );
|
||||
hb_macroGenPCode1( HB_P_ENDPROC, HB_COMP_PARAM );
|
||||
}
|
||||
| Expression error {
|
||||
HB_TRACE(HB_TR_DEBUG, ("macro -> invalid expression: %s", HB_MACRO_DATA->string));
|
||||
hb_macroError( EG_SYNTAX, HB_COMP_PARAM );
|
||||
HB_MACRO_ABORT;
|
||||
}
|
||||
| error {
|
||||
HB_TRACE(HB_TR_DEBUG, ("macro -> invalid syntax: %s", HB_MACRO_DATA->string));
|
||||
hb_macroError( EG_SYNTAX, HB_COMP_PARAM );
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -281,12 +281,11 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro )
|
||||
|
||||
while( pLex->ulSrc < pLex->ulLen )
|
||||
{
|
||||
char ch = pLex->pString[ pLex->ulSrc++ ];
|
||||
unsigned char ch = ( unsigned char ) pLex->pString[ pLex->ulSrc++ ];
|
||||
switch( ch )
|
||||
{
|
||||
case ' ':
|
||||
case '\t':
|
||||
case '\r':
|
||||
break;
|
||||
|
||||
case '$':
|
||||
@@ -295,8 +294,6 @@ int hb_macrolex( YYSTYPE *yylval_ptr, HB_MACRO_PTR pMacro )
|
||||
case '@':
|
||||
case '(':
|
||||
case '{':
|
||||
case ';':
|
||||
case '\n':
|
||||
pLex->quote = TRUE;
|
||||
return ch;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user