diff --git a/harbour/ChangeLog b/harbour/ChangeLog index fc3dfbfd98..ff4d2af9a6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,20 @@ The license applies to all entries newer than 2009-04-28. */ +2011-01-18 12:32 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbexprb.c + ! allow to use variable in parenthesis as lvalue when -kc switch + is used - Clipper compatibility + + * harbour/contrib/hbfoxpro/misc.prg + + __FOX_ARRAY( ) which returns array initialized + with .F. values - it can be used to initialize arrays declared + using FP syntax + + * harbour/contrib/hbfoxpro/hbfoxpro.ch + + added some new PP rules for FP array declarations + + added DISPLAY FIELDS ... command + 2011-01-17 23:02 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbmxml/hbmxml.c * Reformatted with uncrustify. diff --git a/harbour/contrib/hbfoxpro/hbfoxpro.ch b/harbour/contrib/hbfoxpro/hbfoxpro.ch index 8380a5d60a..292a5492a7 100644 --- a/harbour/contrib/hbfoxpro/hbfoxpro.ch +++ b/harbour/contrib/hbfoxpro/hbfoxpro.ch @@ -51,4 +51,34 @@ * */ + +/* messages in FP */ #xtranslate . => : + + +/* array declarations */ +#xtranslate __FP_DIM( ) => +#xtranslate __FP_DIM( ( ) ) => \[ \] + +#command PUBLIC [, ] => ; + <@> PUBLIC __FP_DIM( ) [, __FP_DIM( ) ] +#command PRIVATE [, ] => ; + <@> PRIVATE __FP_DIM( ) [, __FP_DIM( ) ] +#command DIMENSIONS ( ) [, ( ) ] => ; + PRIVATE \[ \] [, \[ \] ] + + +/* workaround for problem with command using FIELDS keyword which can + wrongly translate FIELD->fieldname. + */ +#translate FIELD-> => _FIELD-> + + +/* commands using FIELDS clause which is not accepted by Clipper */ +#command DISPLAY [FIELDS ] [] ; + [] [TO FILE <(f)>] ; + [FOR ] [WHILE ] [NEXT ] ; + [RECORD ] [] [] => ; + __dbList( <.off.>, { <{v}> }, <.all.>, ; + <{for}>, <{while}>, , ; + , <.rest.>, <.prn.>, <(f)> ) diff --git a/harbour/contrib/hbfoxpro/misc.prg b/harbour/contrib/hbfoxpro/misc.prg index e29eb1ed5d..d0b22112d7 100644 --- a/harbour/contrib/hbfoxpro/misc.prg +++ b/harbour/contrib/hbfoxpro/misc.prg @@ -69,3 +69,20 @@ FUNCTION SYS( nValue, xPar1 ) ENDSWITCH RETURN NIL + + +STATIC PROCEDURE AFILLNESTED( aValue, xVal ) + LOCAL item + + FOR EACH item in aValue + IF hb_isArray( item ) + AFillNested( item, xVal ) + ELSE + item := xVal + ENDIF + NEXT + + RETURN aValue + +FUNCTION __FOX_ARRAY( ... ) + RETURN AFillNested( Array( ... ), .F. ) diff --git a/harbour/include/hbexprb.c b/harbour/include/hbexprb.c index e2bc18e40e..cecb591fda 100644 --- a/harbour/include/hbexprb.c +++ b/harbour/include/hbexprb.c @@ -2544,6 +2544,10 @@ static HB_EXPR_FUNC( hb_compExprUseSetGet ) case HB_EA_REDUCE: pSelf->value.asSetGet.pVar = HB_EXPR_USE( pSelf->value.asSetGet.pVar, HB_EA_REDUCE ); pSelf->value.asSetGet.pExpr = HB_EXPR_USE( pSelf->value.asSetGet.pExpr, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asSetGet.pVar = hb_compExprListStrip( pSelf->value.asSetGet.pVar, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asSetGet.pVar, HB_EA_LVALUE ); break; case HB_EA_ARRAY_AT: @@ -2732,6 +2736,10 @@ static HB_EXPR_FUNC( hb_compExprUsePostInc ) { case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; case HB_EA_ARRAY_AT: @@ -2770,6 +2778,10 @@ static HB_EXPR_FUNC( hb_compExprUsePostDec ) { case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; case HB_EA_ARRAY_AT: @@ -2929,6 +2941,10 @@ static HB_EXPR_FUNC( hb_compExprUsePlusEq ) case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); pSelf->value.asOperator.pRight = HB_EXPR_USE( pSelf->value.asOperator.pRight, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; @@ -2969,6 +2985,10 @@ static HB_EXPR_FUNC( hb_compExprUseMinusEq ) case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); pSelf->value.asOperator.pRight = HB_EXPR_USE( pSelf->value.asOperator.pRight, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; @@ -3009,6 +3029,10 @@ static HB_EXPR_FUNC( hb_compExprUseMultEq ) case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); pSelf->value.asOperator.pRight = HB_EXPR_USE( pSelf->value.asOperator.pRight, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; @@ -3049,6 +3073,10 @@ static HB_EXPR_FUNC( hb_compExprUseDivEq ) case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); pSelf->value.asOperator.pRight = HB_EXPR_USE( pSelf->value.asOperator.pRight, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; @@ -3089,6 +3117,10 @@ static HB_EXPR_FUNC( hb_compExprUseModEq ) case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); pSelf->value.asOperator.pRight = HB_EXPR_USE( pSelf->value.asOperator.pRight, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; @@ -3129,6 +3161,10 @@ static HB_EXPR_FUNC( hb_compExprUseExpEq ) case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); pSelf->value.asOperator.pRight = HB_EXPR_USE( pSelf->value.asOperator.pRight, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; @@ -4334,6 +4370,10 @@ static HB_EXPR_FUNC( hb_compExprUsePreInc ) { case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break; @@ -4374,6 +4414,10 @@ static HB_EXPR_FUNC( hb_compExprUsePreDec ) { case HB_EA_REDUCE: pSelf->value.asOperator.pLeft = HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_REDUCE ); +#if ! defined( HB_MACRO_SUPPORT ) + if( !HB_SUPPORT_HARBOUR ) + pSelf->value.asOperator.pLeft = hb_compExprListStrip( pSelf->value.asOperator.pLeft, HB_COMP_PARAM ); +#endif HB_EXPR_USE( pSelf->value.asOperator.pLeft, HB_EA_LVALUE ); break;