2006-09-18 03:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbclass.ch
    + added MESSAGE ... INLINE ... rule

  * harbour/tests/clsccast.prg
  * harbour/tests/clsicast.prg
  * harbour/tests/clsnv.prg
  * harbour/tests/clsscast.prg
  * harbour/tests/clsscope.prg
    - removed some unnecessary definitions
This commit is contained in:
Przemyslaw Czerpak
2006-09-18 01:13:18 +00:00
parent dc9ebdf37c
commit 7e4609cff3
7 changed files with 24 additions and 39 deletions

View File

@@ -8,6 +8,17 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
in some optimization, f.e.: a[ <exp1> ] += <exp2>
or directly by: func( @a[ <exp> ] )
if we add passing array elements by reference
Implemented in HVM and PCODE generation, the compiler has to be
modified yet to use them.
* changed last parameter in hb_codeblockGetRef() - I'd like to have
all variables in hb_struRefer structure in one place: hb_itemUnRefOnce()
for easier modifications in the future.
* replaced in hb_struRefer 'itemsbase' with 'array'.
+ added hb_arrayGetItemRef() to create references to array elements.
Such reference updates array reference counters.
* changed STATICs passed by reference to use new array item references.
! block destructor execution after classy releasing on HVM exit

View File

@@ -459,6 +459,19 @@ DECLARE HBClass ;
s_oClass:AddInline( <(MethodName)>, {|Self [,<params>] | <Code> }, HBCLSCHOICE( <.export.>, <.protect.>, <.hidde.> ) + iif( <.ctor.>, HB_OO_CLSTP_CTOR, 0 ),;
<.persistent.> )
#xcommand MESSAGE <MethodName> [ AS <type> ] INLINE <Code,...> [ <ctor: CONSTRUCTOR> ] [ <export: EXPORTED, VISIBLE>] [<protect: PROTECTED>] [<hidde: HIDDEN>] ;
[<persistent: PERSISTENT, PROPERTY>] => ;
_HB_MEMBER <MethodName>() [<-ctor-> AS CLASS _CLASS_NAME_] [ AS <type> ];;
s_oClass:AddInline( <(MethodName)>, {|Self | <Code> }, HBCLSCHOICE( <.export.>, <.protect.>, <.hidde.> ) + iif( <.ctor.>, HB_OO_CLSTP_CTOR, 0 ),;
<.persistent.> )
/* Must have secondary version with params because params are used in the block */
#xcommand MESSAGE <MethodName>( [<params,...>] ) [ AS <type> ] INLINE <Code,...> [ <ctor: CONSTRUCTOR> ] [ <export: EXPORTED, VISIBLE>] [<protect: PROTECTED>] [<hidde: HIDDEN>] ;
[<persistent: PERSISTENT, PROPERTY>] => ;
_HB_MEMBER <MethodName>([<params>]) [<-ctor-> AS CLASS _CLASS_NAME_] [ AS <type> ];;
s_oClass:AddInline( <(MethodName)>, {|Self [,<params>] | <Code> }, HBCLSCHOICE( <.export.>, <.protect.>, <.hidde.> ) + iif( <.ctor.>, HB_OO_CLSTP_CTOR, 0 ),;
<.persistent.> )
#xcommand METHOD <MethodName> [ AS <type> ] INLINE [Local <v>,] <Code,...> [<other>] => ;
METHOD <MethodName> [ AS <type> ] BLOCK {|Self [,<v>] | <Code> } [<other>]

View File

@@ -16,15 +16,7 @@
#xtranslate QQOUT([<x,...>]) => [OUTSTD(<x>)]
#xtranslate QOUT([<x,...>]) => OUTSTD(EOL)[;OUTSTD(<x>)]
#ifdef __HARBOUR__
#include "hbclass.ch"
#translate MESSAGE <message> INLINE <*expr*> ;
=> ;
METHOD <message> INLINE <expr>
#else
#include "class(y).ch"
#xtranslate __SENDER( => SENDER(
#endif
proc main()
local o:=myclass4():new(), i, cbErr

View File

@@ -16,15 +16,7 @@
#xtranslate QQOUT([<x,...>]) => [OUTSTD(<x>)]
#xtranslate QOUT([<x,...>]) => OUTSTD(EOL)[;OUTSTD(<x>)]
#ifdef __HARBOUR__
#include "hbclass.ch"
#translate MESSAGE <message> INLINE <*expr*> ;
=> ;
METHOD <message> INLINE <expr>
#else
#include "class(y).ch"
#xtranslate __SENDER( => SENDER(
#endif
proc main()
local o:=myclass4():new(), i, cbErr

View File

@@ -15,15 +15,7 @@
#xtranslate QQOUT([<x,...>]) => [OUTSTD(<x>)]
#xtranslate QOUT([<x,...>]) => OUTSTD(EOL)[;OUTSTD(<x>)]
#ifdef __HARBOUR__
#include "hbclass.ch"
#translate MESSAGE <message> INLINE <*expr*> ;
=> ;
METHOD <message> INLINE <expr>
#else
#include "class(y).ch"
#xtranslate __SENDER( => SENDER(
#endif
proc main()
local o:=myclass3():new(), i, cbErr

View File

@@ -16,15 +16,7 @@
#xtranslate QQOUT([<x,...>]) => [OUTSTD(<x>)]
#xtranslate QOUT([<x,...>]) => OUTSTD(EOL)[;OUTSTD(<x>)]
#ifdef __HARBOUR__
#include "hbclass.ch"
#translate MESSAGE <message> INLINE <*expr*> ;
=> ;
METHOD <message> INLINE <expr>
#else
#include "class(y).ch"
#xtranslate __SENDER( => SENDER(
#endif
proc main()
local o:=myclass4():new(), i, cbErr

View File

@@ -16,14 +16,7 @@
#command ? => OUTSTD(EOL)
#xtranslate QOUT(<x,...>) => OUTSTD(EOL,<x>)
#ifdef __HARBOUR__
#include "hbclass.ch"
#translate MESSAGE <message> INLINE <*expr*> ;
=> ;
METHOD <message> INLINE <expr>
#else
#include "class(y).ch"
#endif
#xcommand MAKE_TEST(<obj>,<v>) ;
=> begin sequence ;;