ChangeLog 200423-19:10 GMT+1
This commit is contained in:
@@ -1,3 +1,26 @@
|
||||
20000423-19:10 GMT+1 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*source/compiler/harbour.y
|
||||
*added support for using references as an array element
|
||||
{ 1, @var }
|
||||
|
||||
*source/vm/itemapi.c
|
||||
*added support for handling of references in arrays
|
||||
Example:
|
||||
a := 1
|
||||
CallProc( { @a } )
|
||||
? a //prints: 2
|
||||
|
||||
PROC CallProc( x )
|
||||
LOCAL y:=x[ 1 ]
|
||||
y++
|
||||
|
||||
NOTE: references in arrays cannot be used with usual operators
|
||||
For example (using the above code)
|
||||
? y + x[ 1 ]
|
||||
will cause 'argument error: +' because hb_vmPlus() (and others)
|
||||
doesn't dereference arguments.
|
||||
|
||||
20000423-18:18 GMT+1 Ryszard Glab <rglab@imid.med.pl>
|
||||
|
||||
*source/compiler/harbour.y
|
||||
|
||||
@@ -925,8 +925,8 @@ IndexList : '[' Expression { $$ = hb_compExprNewArrayAt( $<asExpr
|
||||
| IndexList ']' '[' Expression { $$ = hb_compExprNewArrayAt( $1, $4 ); }
|
||||
;
|
||||
|
||||
ElemList : EmptyExpression { $$ = hb_compExprNewList( $1 ); }
|
||||
| ElemList ',' EmptyExpression { $$ = hb_compExprAddListExpr( $1, $3 ); }
|
||||
ElemList : Argument { $$ = hb_compExprNewList( $1 ); }
|
||||
| ElemList ',' Argument { $$ = hb_compExprAddListExpr( $1, $3 ); }
|
||||
;
|
||||
|
||||
CodeBlock : '{' '|' { $<asExpr>$ = hb_compExprNewCodeBlock(); } BlockNoVar
|
||||
|
||||
@@ -1033,6 +1033,9 @@ void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource )
|
||||
{
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_itemCopy(%p, %p)", pDest, pSource));
|
||||
|
||||
if( HB_IS_BYREF( pDest ) )
|
||||
pDest = hb_itemUnRef( pDest );
|
||||
|
||||
if( pDest->type )
|
||||
hb_itemClear( pDest );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user