20000522-10:40 GMT-8 Ron Pinkas <Ron@Profit-Master.com>

* source/compiler/hbpcode.c
     ! Fixed ambigious else in hb_StrongType()

   * source/pp/pptable.c
     ! Fixed STRUCTURE rule to allow nesting of structures.

   * tests/teststru.prg
     * Enhanced to demonstrate Structure as element of other structure and self reference capabilities.
This commit is contained in:
Ron Pinkas
2000-05-23 01:31:34 +00:00
parent 23f1982817
commit 9f05928bd2
4 changed files with 42 additions and 12 deletions

View File

@@ -1,3 +1,14 @@
20000522-10:40 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* source/compiler/hbpcode.c
! Fixed ambigious else in hb_StrongType()
* source/pp/pptable.c
! Fixed STRUCTURE rule to allow nesting of structures.
* tests/teststru.prg
* Enhanced to demonstrate Structure as element of other structure and self reference capabilities.
20000523-02:58 GMT+1 Victor Szakats <info@szelvesz.hu>
; Thanks to Jose Lalin for these:
@@ -19,7 +30,7 @@
% formatting and clean
20000523-02:06 GMT+1 Victor Szakats <info@szelvesz.hu>
* makefile.bc
* makefile.vc
* contrib/hbclip/hbclip.ch
@@ -32,13 +43,13 @@
* source/lang/msgsriso.c
* source/rtl/Makefile
* misc small corrections and fixes.
* include/hbapi.h
* source/rtl/console.c
* source/rtl/xsavescr.c
! Fixed memory leak when no __XRESTSCREEN() was called after an
__XSAVESCREEN()
2000-05-22 18:15 GMT-4 David G. Holm <dholm@jsd-llc.com>
* source/rtl/filesys.c
@@ -49,10 +60,10 @@
+ Added RSX32 to the list of protected mode DOS compilers
that are unable to generate an INT 21h, AX=5E00h call.
20000522-09:40 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
20000522-10:40 GMT-8 Ron Pinkas <Ron@Profit-Master.com>
* contrib/hbclip.ch
! Updated to reflect latest sysntax.
! Updated to reflect latest syntax.
* tests/testwarn.ch
! Updated translate segment to reflect latest sysntax.

View File

@@ -444,10 +444,12 @@ void hb_compStrongType( int iSize )
/*printf( "\nMethod: %s of Class: %s Parameters: %i\n", pSym->szName, pFunc->pStackClasses[ pFunc->iStackClasses - 1 ]->szName, pFunc->pStackFunctions[ pFunc->iStackFunctions - 1 ]->iParamCount );*/
if ( pFunc->pStackFunctions[ pFunc->iStackFunctions - 1 ] == NULL )
{
if ( pSym->szName[0] == '_' )
hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_MESSAGE_NOT_FOUND, &( pSym->szName[1] ), pFunc->pStackClasses[ pFunc->iStackClasses - 1 ]->szName );
else
hb_compGenWarning( hb_comp_szWarnings, 'W', HB_COMP_WARN_MESSAGE_NOT_FOUND, pSym->szName, pFunc->pStackClasses[ pFunc->iStackClasses - 1 ]->szName );
}
}
else
{

View File

@@ -389,7 +389,14 @@ static COMMANDS sC___236 = {0,"SET","INDEX TO [ \1A40 [, \1B40]] [\1C20 ADDITIVE
static COMMANDS sC___237 = {0,"SET","ORDER TO \1A00 [IN \1B40]","ordSetFocus( \1A00 [, \1B30] )",&sC___236 };
static COMMANDS sC___238 = {0,"SET","ORDER TO TAG \1A40 [IN \1B40]","ordSetFocus( \1A30 [, \1B30] )",&sC___237 };
static COMMANDS sC___239 = {0,"SET","ORDER TO","ordSetFocus(0)",&sC___238 };
static COMMANDS sC___240 = {0,"STRUCTURE","\1A00 \1B00 AS \1C00 [, \1D00 AS \1E00 ]","STATIC __\1A00 := {|| IF(__\1A00 == NIL, , ) ,hb_structure( \1A20, { \1B20 [, \1D20] } )} ; DECLARE \1A00 \1B00 AS \1C00 [ \1D00 AS \1E00] ; #translate AS NEW \1A00 => AS CLASS \1A00 := ( Eval(__\1A00), hb_Structure( \1A20 ) )",&sC___239 };
static COMMANDS sC___240 = {0,"STRUCTURE","\1A00 \1B00 \1C20:AS CLASS,AS STRUCTURE,AS STRU,AS ARRAY OF,AS> \1D00 [, \1E00 \1F20:AS CLASS,AS STRUCTURE,AS STRU,AS ARRAY OF,AS> \1G00 ]","STATIC __\1A00 := {|| IF(__\1A00 == NIL, , ) ,hb_structure( \1A20, { \1B20 [, \1E20] } )} ; DECLARE \1A00 \1B00 \1C00 \1D00 [ \1E00 \1F00 \1G00 ] ; #translate AS NEW \1A00 => AS CLASS \1A00 := ( Eval(__\1A00), hb_Structure( \1A20 ) )",&sC___239 };
/*
#COMMAND STRUCTURE <StruName> <Var1> <x1:AS CLASS,AS STRUCTURE,AS STRU,AS ARRAY OF,AS> <Type1> [, <VarN> <xN:AS CLASS,AS STRUCTURE,AS STRU,AS ARRAY OF,AS> <TypeN> ] => ;
STATIC __<StruName> := {|| IF( __<StruName> == NIL, , ) , HB_Structure( <"StruName">, { <"Var1"> [, <"VarN">] } )} ;;
DECLARE <StruName> <Var1> <x1> <Type1> [ <VarN> <xN> <TypeN> ] ;;
#TRANSLATE AS NEW <StruName> => AS STRUCTURE <StruName> := ( Eval( __<StruName> ), HB_Structure( <"StruName"> ) )
*/
static COMMANDS sT___1 = {0,"AS","NEW \1A00","AS CLASS \1A00 := \1A00():New()",NULL };

View File

@@ -1,16 +1,26 @@
STRUCTURE MyStruct Var1 As Char, Var2 As Num
STRUCTURE MyStruct Var1 As Char, Var2 As Num, sNext AS Stru MyStruct
STRUCTURE OtherStruct sNested As Stru MyStruct, sNext AS Structure OtherStruct
PROCEDURE MAIN()
LOCAL sTest AS New MyStruct
LOCAL sTest AS New MyStruct, sTest2 As New OtherStruct
sTest:Var1 := 'Working' // No problem here.
sTest:Var1 := 'Working' // No problem here. (Var1 of myStruct is Char)
? sTest:Var1 // No Problem here.
? sTest:Var1 // No Problem here.
sTest:Var1 := 8 // Warning Here as Expected. -> Var1 of MyStruct is Char not Num
sTest2:sNested:Var1 := 8 // Warning Here Expected -> Var1 of MyStruct is Char not Num
sTest2:sNested:sNext := 8 // Warning Here Expected -> sNext of MyStruct is MyStruct not Num
sTest:Var1 := 8 // Warning Here as Expected.
/* Run TIME ERROR Here */
sTest:NoSuchVar := "Error" // Warning here as expected.
sTest2:sNested:sNested := 8 // Warning Here Expected -> MyStruct has no sNested Var
/* Run TIME ERROR Here */
sTest:NoSuchVar := "Error" // Warning here as expected. -> MyStruct has no NoSuchVar Var.
RETURN