ChangeLog 200423-19:10 GMT+1

This commit is contained in:
Ryszard Glab
2000-04-23 17:06:17 +00:00
parent c197b45373
commit d46faa5837
3 changed files with 28 additions and 2 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 );