Ok Przemek thanks,

Do you permit a question to my learn? :)
In Harbour is possible define rule ExprAssign with LeftExpression as ExprEqual, 
ExprPlusEq, etc ... beacuse it does the same for
all. Not have to do things different if is Variable or MacroVar.

<--- souce/compiler/harbour.y(954) 
----------------------------------------------------------------------------->
ExprAssign  : NumValue        INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | NilValue        INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | DateValue       INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | TimeStampValue  INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | LiteralValue    INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | CodeBlock       INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | Logical         INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | SelfValue       INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | Array           INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | ArrayAt         INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | Hash            INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | AliasVar        INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | AliasExpr       INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | MacroVar        INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | MacroExpr       INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | Variable        INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | VariableAt      INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | PareExpList     INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | IfInline        INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | FunCall         INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | ObjectData      INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            | ObjectMethod    INASSIGN Expression  { $$ = hb_compExprAssign( 
$1, $3, HB_COMP_PARAM ); }
            ;

ExprEqual   : LeftExpression '=' Expression %prec INASSIGN  { $$ = 
hb_compExprAssign( $1, $3, HB_COMP_PARAM ); }
            ;
<---------------------------------------------------------------------------------------------------------------->

--
Xavi

Przemyslaw Czerpak escribió:
On Thu, 02 Jul 2009, Alexander S.Kresin wrote:

Hi,

Maybe, this issue was discussed already, but ...
This code gives an error with Harbour, but works with Clipper:
PROCEDURE main
PRIVATE arr[10], r
   arr[1] := "OO"
   r = 'arr[1]'
   &r += '*'    // Runtime "Syntax error: &" with Harbour
   ? arr[1], r
Return Nil
Is this error or a feature :) ?

Bug. In Harbour when some optimizations are enabled
only pure symbols can be used as macro value in left side
of <op>= or as argument of ++ and -- operators.
With -kc Clipper compatible code is generated so thew above
example will work.
I'll analyze deeper the problem and I'll fix it to make Harbour
fully Clipper compatible. Probably in next week.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour




_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to