From eeb5147b8e1e1bb217a2f8f8b5e0267b28f7e7ed Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 13 Sep 1999 21:59:48 +0000 Subject: [PATCH] 19990913-23:45 GMT+1 --- harbour/ChangeLog | 18 ++++++++++++++++++ harbour/gt.b32 | 2 +- harbour/makefile.b32 | 5 ----- harbour/runner.b32 | 2 +- harbour/source/vm/hvm.c | 10 +++++++++- harbour/tests/working/overload.prg | 4 ---- harbour/tests/working/rtl_test.prg | 4 ---- 7 files changed, 29 insertions(+), 16 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 0808577b07..b0b957d860 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,21 @@ +19990913-23:45 GMT+1 Victor Szel + * source/vm/hvm.c + + hb_vmInString() - Added support for overloading the "$" operator. + ! hb_vmPlus() - Fixed the operator overloading feature. + + hb_vmNotEqual() - Added support for alternate notequal operators: + "<>" and "#". + * tests/working/rtl_test.prg + tests/working/overload.prg + - Removed +=, -= tests, since they will destroy the object, basically + this gets executed: oString := oString + "Hello", where the right side + expression will result in a string, which gets assigned to the object. + This could be fixed by changing the overloader block to return self BTW, + but from the test point of view, this is the same as "+"/"-". + * gt.b32 + makefile.b32 + runner.b32 + ! Fixes by Jose Lalin + 19990913-23:00 GMT+1 Victor Szel * ChangeLog ChangeLog.003 diff --git a/harbour/gt.b32 b/harbour/gt.b32 index ce97e9eb9c..1565d41a77 100644 --- a/harbour/gt.b32 +++ b/harbour/gt.b32 @@ -41,7 +41,7 @@ numtxten.c : numtxten.prg harbour.exe .prg.c: - bin\harbour $< /n /osource\tools /iinclude + bin\harbour $< /n /osource\tools\ /iinclude .c.obj: bcc32 -c -O2 -I.\include -o$@ $< diff --git a/harbour/makefile.b32 b/harbour/makefile.b32 index 6778ab6b53..630452999b 100644 --- a/harbour/makefile.b32 +++ b/harbour/makefile.b32 @@ -24,8 +24,6 @@ harbour.lib : achoice.obj adir.obj alert.obj arrays.obj asort.obj \ set.obj setcolor.obj setkey.obj strfmt.obj strings.obj symbols.obj stringp.obj \ stringsx.obj tbcolumn.obj tbrowse.obj tbrwtext.obj tclass.obj tget.obj tgetlist.obj tone.obj transfrm.obj -symbols.obj : symbols.asm - achoice.obj : achoice.c extend.h hbdefs.h adir.obj : adir.c extend.h hbdefs.h alert.obj : alert.c extend.h hbdefs.h @@ -107,9 +105,6 @@ tget.c : tget.prg harbour.exe tgetlist.c : tgetlist.prg harbour.exe readvar.c : readvar.prg harbour.exe xsavescr.c : xsavescr.prg harbour.exe -.asm.obj: - tasm32 $<, $@ - tlib .\libs\b32\harbour.lib -+$@,, .prg.c: bin\harbour $< /n /osource\rtl\ /iinclude diff --git a/harbour/runner.b32 b/harbour/runner.b32 index 69229d0ce5..33299513fa 100644 --- a/harbour/runner.b32 +++ b/harbour/runner.b32 @@ -17,7 +17,7 @@ runner.c : runner.prg external.c : external.prg .prg.c: - bin\harbour $< /n /osource\runner\stdalone /iinclude /p + bin\harbour $< /n /osource\runner\stdalone\ /iinclude /p .c.obj: bcc32 -c -O2 -I.\include -v -o$@ -DHARBOUR_USE_GTAPI $< diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 437ba86f05..b8e6544e17 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -1441,6 +1441,8 @@ void hb_vmInstring( void ) hb_stackPop(); hb_vmPushLogical( iResult == 0 ? FALSE : TRUE ); } + else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "$" ) ) + hb_vmOperatorCall( pItem1, pItem2, "$" ); else { PHB_ITEM pResult = hb_errRT_BASE_Subst( EG_ARG, 1109, NULL, "$" ); @@ -1660,6 +1662,12 @@ void hb_vmNotEqual( void ) else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "!=" ) ) hb_vmOperatorCall( pItem1, pItem2, "!=" ); + else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "<>" ) ) + hb_vmOperatorCall( pItem1, pItem2, "<>" ); + + else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "#" ) ) + hb_vmOperatorCall( pItem1, pItem2, "#" ); + else if( pItem1->type != pItem2->type ) { PHB_ITEM pResult = hb_errRT_BASE_Subst( EG_ARG, 1072, NULL, "<>" ); @@ -1901,7 +1909,7 @@ void hb_vmPlus( void ) hb_vmPushDate( lDate1 + dNumber2 ); } - else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem2, "+" ) ) + else if( IS_OBJECT( pItem1 ) && hb_objHasMsg( pItem1, "+" ) ) hb_vmOperatorCall( pItem1, pItem2, "+" ); else diff --git a/harbour/tests/working/overload.prg b/harbour/tests/working/overload.prg index 75f639ad7f..dd30147f3f 100644 --- a/harbour/tests/working/overload.prg +++ b/harbour/tests/working/overload.prg @@ -37,10 +37,6 @@ function Main() QOut( "Greater than or Equal:", oString <= "Hello" ) QOut( "Concatenation + :", oString + "Hello" ) QOut( "Concatenation - :", oString - "Hello" ) - oString += " World" - QOut( "Compound += :", oString ) - oString -= " World" - QOut( "Compound -= :", oString ) return nil diff --git a/harbour/tests/working/rtl_test.prg b/harbour/tests/working/rtl_test.prg index 4b8f0ef5b1..6d7df1655d 100644 --- a/harbour/tests/working/rtl_test.prg +++ b/harbour/tests/working/rtl_test.prg @@ -1967,10 +1967,6 @@ STATIC FUNCTION Main_OPOVERL() TEST_LINE( oString <= "Hello" , .T. ) TEST_LINE( oString + "Hello" , "HelloHello" ) TEST_LINE( oString - "Hello" , "HelloHello" ) - oString:cValue := "Hello" - TEST_LINE( oString += " World" , "Hello World" ) - oString:cValue := "Hello" - TEST_LINE( oString -= " World" , "Hello World" ) RETURN NIL