diff --git a/harbour/source/pp/ppcore.c b/harbour/source/pp/ppcore.c index 5566f47e79..2b64a7ae58 100644 --- a/harbour/source/pp/ppcore.c +++ b/harbour/source/pp/ppcore.c @@ -936,6 +936,7 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) } } } + /* Look for definitions from #translate */ stcmd = hb_pp_topTranslate; while( stcmd != NULL ) @@ -970,7 +971,9 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) } /* Look for definitions from #command */ - if( kolpass < 3 ) /* JFL ! */ + /* JFL ! Was 3 but insufficient in most cases */ + /* I know this is a new hardcoded limit ... any better idea's welcome */ + if( kolpass < 20 ) { ptri = sLine + isdvig; HB_SKIPTABSPACES( ptri ); @@ -1018,6 +1021,7 @@ int hb_pp_ParseExpression( char * sLine, char * sOutLine ) *(sLine+isdvig+ipos-1) = ';'; } isdvig += ipos; + } while( ipos != 0 ); diff --git a/harbour/source/rtl/tclass.prg b/harbour/source/rtl/tclass.prg index d8e7f4ce02..1fc157f066 100644 --- a/harbour/source/rtl/tclass.prg +++ b/harbour/source/rtl/tclass.prg @@ -236,15 +236,17 @@ RETURN __clsInst( ::hClass ) //----------------------------------------------------------------------------// -STATIC PROCEDURE AddData( cData, xInit, cType, nScope ) /* xInit is initializer */ +STATIC PROCEDURE AddData( cData, xInit, cType, nScope, lNoinit ) LOCAL Self := QSelf() + if lNoInit==NIL;lNoInit:=.F.;endif + // Default Init for Logical and numeric - IF cType != NIL .AND. xInit == NIL + IF ! lNoInit .AND. cType != NIL .AND. xInit == NIL IF Upper( Left( cType, 1 ) ) == "L" xInit := .F. - ELSEIF Upper( Left( cType, 1 ) ) == "N" + ELSEIF Upper( Left( cType, 1 ) ) $ "NI" /* Numeric Int */ xInit := 0 ENDIF ENDIF @@ -255,7 +257,7 @@ STATIC PROCEDURE AddData( cData, xInit, cType, nScope ) /* xInit is initializer //----------------------------------------------------------------------------// -STATIC PROCEDURE AddMultiData( cType, xInit, nScope, aData ) +STATIC PROCEDURE AddMultiData( cType, xInit, nScope, aData, lNoInit ) LOCAL Self := QSelf() LOCAL i @@ -272,22 +274,24 @@ STATIC PROCEDURE AddMultiData( cType, xInit, nScope, aData ) ENDIF FOR i := 1 TO nParam - ::AddData( aData[ i ], xInit, cType, nScope ) + ::AddData( aData[ i ], xInit, cType, nScope, lNoInit ) NEXT RETURN //----------------------------------------------------------------------------// -STATIC PROCEDURE AddClassData( cData, xInit, cType, nScope ) +STATIC PROCEDURE AddClassData( cData, xInit, cType, nScope, lNoInit ) LOCAL Self := QSelf() + if lNoInit==NIL;lNoInit:=.F.;endif + // Default Init for Logical and numeric - IF cType != NIL .AND. xInit == NIL + IF ! lNoInit .AND. cType != NIL .AND. xInit == NIL IF Upper( Left( cType, 1 ) ) == "L" xInit := .F. - ELSEIF Upper( Left( cType, 1 ) ) == "N" + ELSEIF Upper( Left( cType, 1 ) ) $ "NI" /* Numeric Int */ xInit := 0 ENDIF ENDIF @@ -298,7 +302,7 @@ STATIC PROCEDURE AddClassData( cData, xInit, cType, nScope ) //----------------------------------------------------------------------------// -STATIC PROCEDURE AddMultiClsData( cType, xInit, nScope, aData ) +STATIC PROCEDURE AddMultiClsData( cType, xInit, nScope, aData, lNoInit ) LOCAL Self := QSelf() LOCAL i @@ -315,7 +319,7 @@ STATIC PROCEDURE AddMultiClsData( cType, xInit, nScope, aData ) ENDIF FOR i := 1 TO nParam - ::AddClassData( aData[ i ], xInit, cType, nScope ) + ::AddClassData( aData[ i ], xInit, cType, nScope, lNoInit ) NEXT RETURN diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index 1068710e75..6bfc7bc9b1 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -389,14 +389,27 @@ void hb_clsScope( PHB_ITEM pObject, PMETHOD pMethod ) char * szNameBase; char * szNameObject; - while( ( iLevel-- > 0 ) && pBase != hb_stack.pItems ) + if ( (( uiScope & HB_OO_CLSTP_PROTECTED ) == HB_OO_CLSTP_PROTECTED ) || + (( uiScope & HB_OO_CLSTP_HIDDEN ) == HB_OO_CLSTP_HIDDEN ) || + (( uiScope & HB_OO_CLSTP_READONLY ) == HB_OO_CLSTP_READONLY ) + ) + { + + while( ( iLevel-- > 0 ) && pBase != hb_stack.pItems ) pBase = hb_stack.pItems + pBase->item.asSymbol.stackbase; - szNameBase = hb_objGetClsName( pBase + 1 ); - szNameObject = hb_objGetClsName( pObject ); + szNameBase = hb_objGetClsName( pBase + 1 ); + szNameObject = hb_objGetClsName( pObject ); - if( iLevel == -1 ) - { + /* Huumm probably an inline so back one ... */ + if ( ( strcmp( szNameBase, "__EVAL" ) != 0 ) && pBase != hb_stack.pItems) + { + pBase = hb_stack.pItems + pBase->item.asSymbol.stackbase; + szNameBase = hb_objGetClsName( pBase + 1 ); + } + + if( iLevel == -1 ) + { if( ( pBase + 1 )->type == HB_IT_ARRAY ) /* it is a message */ { if( ( uiScope & HB_OO_CLSTP_PROTECTED ) == HB_OO_CLSTP_PROTECTED ) @@ -469,7 +482,9 @@ void hb_clsScope( PHB_ITEM pObject, PMETHOD pMethod ) } #endif - } + } + + } } ULONG hb_cls_MsgToNum( PHB_DYNS pMsg )