See ChangeLog entry 19990513-22:20 EDT David G. Holm <dholm@jsd-llc.com>

This commit is contained in:
David G. Holm
1999-05-14 23:40:34 +00:00
parent f99c2417b3
commit 3a1254b10f
4 changed files with 33 additions and 12 deletions

View File

@@ -1,3 +1,15 @@
19990513-22:20 EDT David G. Holm <dholm@jsd-llc.com>
* makefile.b31
- Put harbour.obj back into the harbour.exe build.
* source/compiler/harbour.y
- Changed Expression EQ (for ==) to generate new PCODE _EXACTLYEQUAL, again.
* source/vm/hvm.c
- Modifed the Equal function to take one parameter: BOOL bExact, again.
- Modified the handler for PCODE _EQUAL to call Equal( FALSE ), again.
- Added new handler for PCODE _EXACTLYEQUAL, which calls Equal( TRUE ), again.
- Modified the Equal function to call hb_itemStrCmp with bExact as the new
third parameter, again.
19990514-23:45 CET Eddie Runia
* source/rtl/set.c
IS_STRING and IS_LOGICAL called without checking for empty pItem.

View File

@@ -92,8 +92,7 @@ transfrm.obj : transfrm.c extend.h types.h
harbour.exe : y_tab.obj lexyy.obj lex_tab.obj harbour.obj genobj32.obj
echo -mh -O2 -ebin\harbour.exe -Iinclude;source\compiler obj\y_tab.obj > b31.bc
echo obj\lexyy.obj obj\lex_tab.obj >> b31.bc
# echo obj\harbour.obj obj\genobj32.obj >> b31.bc
echo obj\genobj32.obj >> b31.bc
echo obj\harbour.obj obj\genobj32.obj >> b31.bc
bcc @b31.bc
fixflex.obj : source\compiler\fixflex.c

View File

@@ -676,7 +676,7 @@ Operators : Expression '=' Expression { GenPCode1( _EQUAL ); } /* compare
Expression { GenPCode1( AND_ ); if( _iShortCuts ) JumpHere( $<iNumber>3 ); }
| Expression OR { if( _iShortCuts ){ Duplicate(); $<iNumber>$ = JumpTrue( 0 ); } }
Expression { GenPCode1( OR_ ); if( _iShortCuts ) JumpHere( $<iNumber>3 ); }
| Expression EQ Expression { GenPCode1( _EQUAL ); }
| Expression EQ Expression { GenPCode1( _EXACTLYEQUAL ); }
| Expression NE1 Expression { GenPCode1( _NOTEQUAL ); }
| Expression NE2 Expression { GenPCode1( _NOTEQUAL ); }
| Expression POWER Expression { GenPCode1( _POWER ); }
@@ -1821,6 +1821,11 @@ void GenCCode( char *szFileName, char *szName ) /* generates the C languag
lPCodePos++;
break;
case _EXACTLYEQUAL:
fprintf( yyc, " _EXACTLYEQUAL,\n" );
lPCodePos++;
break;
case _ENDBLOCK:
--iNestedCodeblock;
fprintf( yyc, " _ENDBLOCK,\n" );

View File

@@ -37,7 +37,7 @@ void Do( WORD WParams ); /* invoke the virtual machine */
HARBOUR DoBlock( void ); /* executes a codeblock */
void Duplicate( void ); /* duplicates the latest value on the stack */
void EndBlock( void ); /* copies the last codeblock pushed value into the return value */
void Equal( void ); /* checks if the two latest values on the stack are equal, removes both and leaves result */
void Equal( BOOL bExact ); /* checks if the two latest values on the stack are equal, removes both and leaves result */
void ForTest( void ); /* test for end condition of for */
void Frame( BYTE bLocals, BYTE bParams ); /* increases the stack pointer for the amount of locals and params suplied */
void FuncPtr( void ); /* pushes a function address pointer. Removes the symbol from the satck */
@@ -260,7 +260,12 @@ void VirtualMachine( PBYTE pCode, PSYMBOL pSymbols )
return; /* end of a codeblock - stop evaluation */
case _EQUAL:
Equal();
Equal( FALSE );
w++;
break;
case _EXACTLYEQUAL:
Equal( TRUE );
w++;
break;
@@ -738,7 +743,7 @@ void EndBlock( void )
HBDEBUG( "EndBlock\n" );
}
void Equal( void )
void Equal( BOOL bExact )
{
PITEM pItem2 = stack.pPos - 1;
PITEM pItem1 = stack.pPos - 2;
@@ -760,7 +765,7 @@ void Equal( void )
else if( IS_STRING( pItem1 ) && IS_STRING( pItem2 ) )
{
i = hb_itemStrCmp( pItem1, pItem2, TRUE );
i = hb_itemStrCmp( pItem1, pItem2, bExact );
StackPop();
StackPop();
PushLogical( i == 0 );
@@ -872,7 +877,7 @@ void Greater( void )
if( IS_STRING( stack.pPos - 2 ) && IS_STRING( stack.pPos - 1 ) )
{
i = hb_itemStrCmp( stack.pPos - 2, stack.pPos - 1, TRUE );
i = hb_itemStrCmp( stack.pPos - 2, stack.pPos - 1, FALSE );
StackPop();
StackPop();
PushLogical( i > 0 );
@@ -915,7 +920,7 @@ void GreaterEqual( void )
if( IS_STRING( stack.pPos - 2 ) && IS_STRING( stack.pPos - 1 ) )
{
i = hb_itemStrCmp( stack.pPos - 2, stack.pPos - 1, TRUE );
i = hb_itemStrCmp( stack.pPos - 2, stack.pPos - 1, FALSE );
StackPop();
StackPop();
PushLogical( i >= 0 );
@@ -1033,7 +1038,7 @@ void Less( void )
if( IS_STRING( stack.pPos - 2 ) && IS_STRING( stack.pPos - 1 ) )
{
i = hb_itemStrCmp( stack.pPos - 2, stack.pPos - 1, TRUE );
i = hb_itemStrCmp( stack.pPos - 2, stack.pPos - 1, FALSE );
StackPop();
StackPop();
PushLogical( i < 0 );
@@ -1076,7 +1081,7 @@ void LessEqual( void )
if( IS_STRING( stack.pPos - 2 ) && IS_STRING( stack.pPos - 1 ) )
{
i = hb_itemStrCmp( stack.pPos - 2, stack.pPos - 1, TRUE );
i = hb_itemStrCmp( stack.pPos - 2, stack.pPos - 1, FALSE );
StackPop();
StackPop();
PushLogical( i <= 0 );
@@ -1171,7 +1176,7 @@ void NotEqual( void )
else if( IS_STRING( pItem1 ) && IS_STRING( pItem2 ) )
{
i = hb_itemStrCmp( pItem1, pItem2, TRUE );
i = hb_itemStrCmp( pItem1, pItem2, FALSE );
StackPop();
StackPop();
PushLogical( i != 0 );