2012-05-16 19:23 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/src/vm/classes.c
% small optimization in __CLSGetProperties() function
* harbour/src/rtl/tpersist.prg
! force linkin ARRAY() function when HBPersistent class is used
! use hb_ValToExp() instead of local ValToText() function which
didn't work correctly for memos and some other types
! fixed infinite loop in HBPersistent:LoadFromText() used with
empty text. The problem was also exploited by :LoadFromFile()
method if file does not exists or it's empty()
! fixed deserialization of strings containing "=" char inside
! fixed deserialization of strings containing "::"
! added support for decoding nested objects - the code was not
finished and this part was not implemented at all
+ added support for serialized text using ":=" assign operator
instead of "="
* use ":=" instead of "=" as assign operator in new serialized
text
+ ignore lines starting with "//" and added support for files
which do not start with OBJECT directive
* ignore pointer and codeblock items stored in instance variables
during serialization
; now HBPersistent class in Harbour should read serialized files
created in xHarbour with few exceptions:
- Harbour does not allow to serialize codeblocks
See "CODEBLOCK SERIALIZATION / DESERIALIZATION" in
doc/xhb-diff.txt for the reasons.
If Harbour application restores xHarbour HBPersistent files
with serialized codeblocks then RTE
Undefined function: HB_RESTOREBLOCK
is generated.
- xHarbour serialize pointer items as numeric items
saved in hexadecimal notation. Then restore them as numbers.
- HBPersistent does not support hash arrays - they are
serialized by default serialization code used by both
compilers to generate expressions.
In Harbour it's done by hb_valToExp() function and
in xHarbour it's ValToPrg() is used.
ValToPrg() does not create valid macrocompiler expressions
for arrays and objects so HBPersistent files created
by xHarbour are broken and cannot be correctly deserialized.
It happens if objects has hash arrays in instance variables
and these hash arrays contain normal arrays or object
If Harbour application restores such xHarbour HBPersistent
file then RTE "Syntax error: &" is generated.
; xHarbour encapsulates deserialization code inside TRY/CATCH/END
statement saving errors to trace.log file. Harbour generates RTE.
If programmer needs similar behavior then he should
call :LoadFromText() and :LoadFromFile() methods inside
BEGIN SEQUENCE [ / RECOVER ... ] / END SEQUENCE
statement.
; xHarbour reinitialize all or properties instance variables to
default state inside :LoadFromText() and :LoadFromFile() methods.
The 3-rd parameter in above method <lPropertiesOnly> allows to
chose which install variables should be reinitialized:
all (default) or properties only.
Harbour does not have such functionality.
If programmer needs it then he should reinitialize them himself.
It can be easy done be simple function.
Alternatively we can implement this functionality but in such
case I'd suggest to define three actions for such switch:
none (default), all, properties only.
; Harbour does not support 2-nd parameter <lIgnoreBadIVars> which
exist in xHarbour versions of HBPersistent:LoadFromText() and
HBPersistent:LoadFromFile():
If necessary we can implement it though it's usable only if we
want to ignore some wrong lines and process others.
; Warning: Neither Harbour nor xHarbour supports arrays and objects
with cyclic references in HBPersistent code - infinite
loop appears in such case.
; I've never used HBPersistent and the state of the previous
HBPersistent code in Harbour suggests that no one used it for
some serious jobs so I'm open for any opinions and suggestions
about it from xHarbour users.
* harbour/src/compiler/harbour.y
* generate line numbers before extended codeblocks - it gives
more debugger friendly code.
* harbour/src/compiler/harbour.yyh
* harbour/src/compiler/harbour.yyc
* regenerated (with bison 2.4.1)
This commit is contained in:
@@ -16,6 +16,90 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2012-05-16 19:23 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
|
||||
* harbour/src/vm/classes.c
|
||||
% small optimization in __CLSGetProperties() function
|
||||
|
||||
* harbour/src/rtl/tpersist.prg
|
||||
! force linkin ARRAY() function when HBPersistent class is used
|
||||
! use hb_ValToExp() instead of local ValToText() function which
|
||||
didn't work correctly for memos and some other types
|
||||
! fixed infinite loop in HBPersistent:LoadFromText() used with
|
||||
empty text. The problem was also exploited by :LoadFromFile()
|
||||
method if file does not exists or it's empty()
|
||||
! fixed deserialization of strings containing "=" char inside
|
||||
! fixed deserialization of strings containing "::"
|
||||
! added support for decoding nested objects - the code was not
|
||||
finished and this part was not implemented at all
|
||||
+ added support for serialized text using ":=" assign operator
|
||||
instead of "="
|
||||
* use ":=" instead of "=" as assign operator in new serialized
|
||||
text
|
||||
+ ignore lines starting with "//" and added support for files
|
||||
which do not start with OBJECT directive
|
||||
* ignore pointer and codeblock items stored in instance variables
|
||||
during serialization
|
||||
; now HBPersistent class in Harbour should read serialized files
|
||||
created in xHarbour with few exceptions:
|
||||
- Harbour does not allow to serialize codeblocks
|
||||
See "CODEBLOCK SERIALIZATION / DESERIALIZATION" in
|
||||
doc/xhb-diff.txt for the reasons.
|
||||
If Harbour application restores xHarbour HBPersistent files
|
||||
with serialized codeblocks then RTE
|
||||
Undefined function: HB_RESTOREBLOCK
|
||||
is generated.
|
||||
- xHarbour serialize pointer items as numeric items
|
||||
saved in hexadecimal notation. Then restore them as numbers.
|
||||
- HBPersistent does not support hash arrays - they are
|
||||
serialized by default serialization code used by both
|
||||
compilers to generate expressions.
|
||||
In Harbour it's done by hb_valToExp() function and
|
||||
in xHarbour it's ValToPrg() is used.
|
||||
ValToPrg() does not create valid macrocompiler expressions
|
||||
for arrays and objects so HBPersistent files created
|
||||
by xHarbour are broken and cannot be correctly deserialized.
|
||||
It happens if objects has hash arrays in instance variables
|
||||
and these hash arrays contain normal arrays or object
|
||||
If Harbour application restores such xHarbour HBPersistent
|
||||
file then RTE "Syntax error: &" is generated.
|
||||
; xHarbour encapsulates deserialization code inside TRY/CATCH/END
|
||||
statement saving errors to trace.log file. Harbour generates RTE.
|
||||
If programmer needs similar behavior then he should
|
||||
call :LoadFromText() and :LoadFromFile() methods inside
|
||||
BEGIN SEQUENCE [ / RECOVER ... ] / END SEQUENCE
|
||||
statement.
|
||||
; xHarbour reinitialize all or properties instance variables to
|
||||
default state inside :LoadFromText() and :LoadFromFile() methods.
|
||||
The 3-rd parameter in above method <lPropertiesOnly> allows to
|
||||
chose which install variables should be reinitialized:
|
||||
all (default) or properties only.
|
||||
Harbour does not have such functionality.
|
||||
If programmer needs it then he should reinitialize them himself.
|
||||
It can be easy done be simple function.
|
||||
Alternatively we can implement this functionality but in such
|
||||
case I'd suggest to define three actions for such switch:
|
||||
none (default), all, properties only.
|
||||
; Harbour does not support 2-nd parameter <lIgnoreBadIVars> which
|
||||
exist in xHarbour versions of HBPersistent:LoadFromText() and
|
||||
HBPersistent:LoadFromFile():
|
||||
If necessary we can implement it though it's usable only if we
|
||||
want to ignore some wrong lines and process others.
|
||||
; Warning: Neither Harbour nor xHarbour supports arrays and objects
|
||||
with cyclic references in HBPersistent code - infinite
|
||||
loop appears in such case.
|
||||
; I've never used HBPersistent and the state of the previous
|
||||
HBPersistent code in Harbour suggests that no one used it for
|
||||
some serious jobs so I'm open for any opinions and suggestions
|
||||
about it from xHarbour users.
|
||||
|
||||
* harbour/src/compiler/harbour.y
|
||||
* generate line numbers before extended codeblocks - it gives
|
||||
more debugger friendly code.
|
||||
|
||||
* harbour/src/compiler/harbour.yyh
|
||||
* harbour/src/compiler/harbour.yyc
|
||||
* regenerated (with bison 2.4.1)
|
||||
|
||||
2012-05-16 18:38 UTC+0200 Viktor Szakats (harbour syenar.net)
|
||||
* src/rtl/hbgtcore.c
|
||||
* src/rtl/rat.c
|
||||
|
||||
@@ -431,7 +431,7 @@ Statement : ExecFlow CrlfStmnt
|
||||
}
|
||||
HB_COMP_PARAM->functions.pLast->funFlags |= FUN_WITH_RETURN | FUN_BREAK_CODE;
|
||||
}
|
||||
| PUBLIC { hb_compLinePushIfInside( HB_COMP_PARAM ); HB_COMP_PARAM->iVarScope = VS_PUBLIC; }
|
||||
| PUBLIC { hb_compLinePushIfInside( HB_COMP_PARAM ); HB_COMP_PARAM->iVarScope = VS_PUBLIC; }
|
||||
ExtVarList
|
||||
{ hb_compRTVariableGen( HB_COMP_PARAM, "__MVPUBLIC" );
|
||||
HB_COMP_PARAM->iVarScope = VS_NONE;
|
||||
@@ -1037,6 +1037,7 @@ CodeBlock : BlockHead
|
||||
{ /* 3 */
|
||||
HB_CBVAR_PTR pVar;
|
||||
$<sNumber>$ = HB_COMP_PARAM->functions.pLast->nPCodePos;
|
||||
$<sNumber>2 = HB_COMP_PARAM->lastLine;
|
||||
hb_compCodeBlockStart( HB_COMP_PARAM, HB_TRUE );
|
||||
HB_COMP_PARAM->functions.pLast->funFlags |= FUN_EXTBLOCK;
|
||||
HB_COMP_PARAM->functions.pLast->fVParams =
|
||||
@@ -1065,6 +1066,7 @@ CodeBlock : BlockHead
|
||||
HB_COMP_PARAM->functions.pLast->pCode + $<sNumber>3,
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos - $<sNumber>3 );
|
||||
HB_COMP_PARAM->functions.pLast->nPCodePos = $<sNumber>3;
|
||||
HB_COMP_PARAM->lastLine = $<sNumber>2;
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,15 @@
|
||||
/* A Bison parser, made by GNU Bison 2.3. */
|
||||
|
||||
/* A Bison parser, made by GNU Bison 2.4.1. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
@@ -16,9 +17,7 @@
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* As a special exception, you may create a larger work that contains
|
||||
part or all of the Bison parser skeleton and distribute that work
|
||||
@@ -33,6 +32,7 @@
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
@@ -150,124 +150,16 @@
|
||||
PRE = 366
|
||||
};
|
||||
#endif
|
||||
/* Tokens. */
|
||||
#define FUNCTION 258
|
||||
#define PROCEDURE 259
|
||||
#define IDENTIFIER 260
|
||||
#define RETURN 261
|
||||
#define NIL 262
|
||||
#define NUM_DOUBLE 263
|
||||
#define INASSIGN 264
|
||||
#define NUM_LONG 265
|
||||
#define LOCAL 266
|
||||
#define STATIC 267
|
||||
#define IIF 268
|
||||
#define IF 269
|
||||
#define ELSE 270
|
||||
#define ELSEIF 271
|
||||
#define END 272
|
||||
#define ENDIF 273
|
||||
#define LITERAL 274
|
||||
#define TRUEVALUE 275
|
||||
#define FALSEVALUE 276
|
||||
#define ANNOUNCE 277
|
||||
#define EXTERN 278
|
||||
#define DYNAMIC 279
|
||||
#define INIT 280
|
||||
#define EXIT 281
|
||||
#define AND 282
|
||||
#define OR 283
|
||||
#define NOT 284
|
||||
#define PUBLIC 285
|
||||
#define EQ 286
|
||||
#define NE1 287
|
||||
#define NE2 288
|
||||
#define INC 289
|
||||
#define DEC 290
|
||||
#define ALIASOP 291
|
||||
#define DOCASE 292
|
||||
#define CASE 293
|
||||
#define OTHERWISE 294
|
||||
#define ENDCASE 295
|
||||
#define ENDDO 296
|
||||
#define MEMVAR 297
|
||||
#define WHILE 298
|
||||
#define LOOP 299
|
||||
#define FOR 300
|
||||
#define NEXT 301
|
||||
#define TO 302
|
||||
#define STEP 303
|
||||
#define LE 304
|
||||
#define GE 305
|
||||
#define FIELD 306
|
||||
#define IN 307
|
||||
#define PARAMETERS 308
|
||||
#define PLUSEQ 309
|
||||
#define MINUSEQ 310
|
||||
#define MULTEQ 311
|
||||
#define DIVEQ 312
|
||||
#define POWER 313
|
||||
#define EXPEQ 314
|
||||
#define MODEQ 315
|
||||
#define PRIVATE 316
|
||||
#define BEGINSEQ 317
|
||||
#define BREAK 318
|
||||
#define RECOVER 319
|
||||
#define RECOVERUSING 320
|
||||
#define ALWAYS 321
|
||||
#define ENDSEQ 322
|
||||
#define DO 323
|
||||
#define WITH 324
|
||||
#define SELF 325
|
||||
#define LINE 326
|
||||
#define MACROVAR 327
|
||||
#define MACROTEXT 328
|
||||
#define AS_ARRAY 329
|
||||
#define AS_BLOCK 330
|
||||
#define AS_CHARACTER 331
|
||||
#define AS_CLASS 332
|
||||
#define AS_DATE 333
|
||||
#define AS_LOGICAL 334
|
||||
#define AS_NUMERIC 335
|
||||
#define AS_OBJECT 336
|
||||
#define AS_VARIANT 337
|
||||
#define DECLARE 338
|
||||
#define OPTIONAL 339
|
||||
#define DECLARE_CLASS 340
|
||||
#define DECLARE_MEMBER 341
|
||||
#define AS_ARRAY_ARRAY 342
|
||||
#define AS_BLOCK_ARRAY 343
|
||||
#define AS_CHARACTER_ARRAY 344
|
||||
#define AS_CLASS_ARRAY 345
|
||||
#define AS_DATE_ARRAY 346
|
||||
#define AS_LOGICAL_ARRAY 347
|
||||
#define AS_NUMERIC_ARRAY 348
|
||||
#define AS_OBJECT_ARRAY 349
|
||||
#define PROCREQ 350
|
||||
#define CBSTART 351
|
||||
#define DOIDENT 352
|
||||
#define FOREACH 353
|
||||
#define DESCEND 354
|
||||
#define DOSWITCH 355
|
||||
#define ENDSWITCH 356
|
||||
#define WITHOBJECT 357
|
||||
#define ENDWITH 358
|
||||
#define NUM_DATE 359
|
||||
#define TIMESTAMP 360
|
||||
#define EPSILON 361
|
||||
#define HASHOP 362
|
||||
#define THREAD 363
|
||||
#define POST 364
|
||||
#define UNARY 365
|
||||
#define PRE 366
|
||||
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
#line 117 "harbour.y"
|
||||
{
|
||||
|
||||
/* Line 1676 of yacc.c */
|
||||
#line 117 "harbour.y"
|
||||
|
||||
const char * string; /* to hold a string returned by lex */
|
||||
int iNumber; /* to hold a temporary integer number */
|
||||
HB_SIZE sNumber; /* to hold a temporary HB_SIZE values */
|
||||
@@ -304,14 +196,17 @@ typedef union YYSTYPE
|
||||
int flags; /* Flag for early {|| ¯o} (1) or late {|| &(macro)} (2) binding */
|
||||
} asCodeblock;
|
||||
PHB_VARTYPE asVarType;
|
||||
}
|
||||
/* Line 1496 of yacc.c. */
|
||||
#line 310 "harboury.h"
|
||||
YYSTYPE;
|
||||
|
||||
|
||||
|
||||
/* Line 1676 of yacc.c */
|
||||
#line 204 "harboury.h"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@
|
||||
#include "hbclass.ch"
|
||||
#include "common.ch"
|
||||
|
||||
REQUEST ARRAY
|
||||
|
||||
CREATE CLASS HBPersistent
|
||||
|
||||
METHOD CreateNew() INLINE Self
|
||||
@@ -66,8 +68,10 @@ ENDCLASS
|
||||
METHOD LoadFromText( cObjectText ) CLASS HBPersistent
|
||||
|
||||
LOCAL nFrom := 1
|
||||
LOCAL nPos
|
||||
LOCAL cLine
|
||||
LOCAL lStart := .t.
|
||||
LOCAL aObjects := { Self }
|
||||
|
||||
PRIVATE oSelf
|
||||
|
||||
@@ -75,31 +79,47 @@ METHOD LoadFromText( cObjectText ) CLASS HBPersistent
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
/* We skip the first empty lines */
|
||||
DO WHILE Empty( ExtractLine( cObjectText, @nFrom ) )
|
||||
ENDDO
|
||||
|
||||
DO WHILE nFrom <= Len( cObjectText )
|
||||
cLine := ExtractLine( cObjectText, @nFrom )
|
||||
cLine := AllTrim( ExtractLine( cObjectText, @nFrom ) )
|
||||
|
||||
DO CASE
|
||||
CASE Empty( cLine ) .OR. Left( cLine, 2 ) == "//"
|
||||
/* ignore comments and empty lines */
|
||||
|
||||
CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "OBJECT"
|
||||
IF lStart
|
||||
lStart := .F.
|
||||
ELSE
|
||||
cLine := SubStr( cLine, At( "::", cLine ) )
|
||||
MEMVAR->oSelf := ATail( aObjects )
|
||||
cLine := StrTran( cLine, "::", "oSelf:",, 1 )
|
||||
cLine := StrTran( cLine, " AS ", " := " ) + "():CreateNew()"
|
||||
AAdd( aObjects, &( cLine ) )
|
||||
ENDIF
|
||||
|
||||
CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "ENDOBJECT"
|
||||
ASize( aObjects, Len( aObjects ) - 1 )
|
||||
IF Empty( aObjects )
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
CASE hb_asciiUpper( LTrim( hb_TokenGet( cLine, 1 ) ) ) == "ARRAY"
|
||||
cLine := SubStr( cLine, At( "::", cLine ) )
|
||||
MEMVAR->oSelf := Self
|
||||
cLine := StrTran( cLine, "::", "oSelf:" )
|
||||
cLine := StrTran( cLine, " LEN ", " = Array( " )
|
||||
cLine := RTrim( StrTran( cLine, "=", ":=", , 1 ) ) + " )"
|
||||
MEMVAR->oSelf := ATail( aObjects )
|
||||
cLine := StrTran( cLine, "::", "oSelf:",, 1 )
|
||||
cLine := StrTran( cLine, " LEN ", " := Array( " ) + " )"
|
||||
&( cLine )
|
||||
|
||||
CASE Left( LTrim( hb_TokenGet( cLine, 1, "=" ) ), 2 ) == "::"
|
||||
MEMVAR->oSelf := Self
|
||||
cLine := StrTran( cLine, "::", "oSelf:" )
|
||||
cLine := StrTran( cLine, "=", ":=", , 1 )
|
||||
CASE Left( cLine, 2 ) == "::"
|
||||
/* fix for older versions */
|
||||
nPos := At( "=", cLine )
|
||||
IF nPos > 0
|
||||
IF !( SubStr( cLine, nPos - 1, 1 ) == ":" )
|
||||
cLine := Stuff( cLine, nPos, 0, ":" )
|
||||
ENDIF
|
||||
ENDIF
|
||||
MEMVAR->oSelf := ATail( aObjects )
|
||||
cLine := StrTran( cLine, "::", "oSelf:",, 1 )
|
||||
&( cLine )
|
||||
|
||||
ENDCASE
|
||||
@@ -141,31 +161,38 @@ METHOD SaveToText( cObjectName, nIndent ) CLASS HBPersistent
|
||||
|
||||
IF !( cType == ValType( uNewValue ) ) .OR. !( uValue == uNewValue )
|
||||
|
||||
DO CASE
|
||||
CASE cType == "A"
|
||||
SWITCH cType
|
||||
CASE "A"
|
||||
nIndent += 3
|
||||
cObject += ArrayToText( uValue, aProperties[ n ], nIndent )
|
||||
nIndent -= 3
|
||||
IF n < Len( aProperties )
|
||||
cObject += hb_eol()
|
||||
ENDIF
|
||||
EXIT
|
||||
|
||||
CASE cType == "O"
|
||||
CASE "O"
|
||||
IF __objDerivedFrom( uValue, "HBPERSISTENT" )
|
||||
cObject += uValue:SaveToText( aProperties[ n ], nIndent )
|
||||
ENDIF
|
||||
IF n < Len( aProperties )
|
||||
cObject += hb_eol()
|
||||
ENDIF
|
||||
EXIT
|
||||
|
||||
CASE "B"
|
||||
CASE "P"
|
||||
/* ignore codeblock and pointer items */
|
||||
EXIT
|
||||
|
||||
OTHERWISE
|
||||
IF n == 1
|
||||
cObject += hb_eol()
|
||||
ENDIF
|
||||
cObject += Space( nIndent ) + " ::" + ;
|
||||
aProperties[ n ] + " = " + ValToText( uValue ) + ;
|
||||
aProperties[ n ] + " := " + hb_ValToExp( uValue ) + ;
|
||||
hb_eol()
|
||||
ENDCASE
|
||||
ENDSWITCH
|
||||
|
||||
ENDIF
|
||||
|
||||
@@ -200,13 +227,18 @@ STATIC FUNCTION ArrayToText( aArray, cName, nIndent )
|
||||
ENDIF
|
||||
EXIT
|
||||
|
||||
CASE "B"
|
||||
CASE "P"
|
||||
/* ignore codeblock and pointer items */
|
||||
EXIT
|
||||
|
||||
OTHERWISE
|
||||
IF n == 1
|
||||
cArray += hb_eol()
|
||||
ENDIF
|
||||
cArray += Space( nIndent ) + " ::" + cName + ;
|
||||
+ "[ " + hb_NToS( n ) + " ]" + " = " + ;
|
||||
ValToText( uValue ) + hb_eol()
|
||||
+ "[ " + hb_NToS( n ) + " ]" + " := " + ;
|
||||
hb_ValToExp( uValue ) + hb_eol()
|
||||
ENDSWITCH
|
||||
NEXT
|
||||
|
||||
@@ -214,21 +246,6 @@ STATIC FUNCTION ArrayToText( aArray, cName, nIndent )
|
||||
|
||||
RETURN cArray
|
||||
|
||||
STATIC FUNCTION ValToText( uValue )
|
||||
|
||||
SWITCH ValType( uValue )
|
||||
CASE "C"
|
||||
RETURN hb_StrToExp( uValue )
|
||||
CASE "N"
|
||||
RETURN hb_NToS( uValue )
|
||||
CASE "D"
|
||||
RETURN "0d" + iif( Empty( DToS( uValue ) ), "00000000", DToS( uValue ) )
|
||||
CASE "T"
|
||||
RETURN 't"' + hb_TSToStr( uValue, .T. ) + '"'
|
||||
ENDSWITCH
|
||||
|
||||
RETURN hb_ValToStr( uValue )
|
||||
|
||||
/* Notice: nFrom must be supplied by reference */
|
||||
|
||||
STATIC FUNCTION ExtractLine( cText, nFrom )
|
||||
|
||||
@@ -4960,8 +4960,9 @@ HB_FUNC( __CLSGETPROPERTIES )
|
||||
++nCount;
|
||||
else if( pMethod->pMessage->pSymbol->szName[ 0 ] == '_' )
|
||||
{
|
||||
PHB_DYNS pMsg = hb_dynsymFind( pMethod->pMessage->pSymbol->szName + 1 );
|
||||
if( pMsg && hb_clsFindMsg( pClass, pMsg ) )
|
||||
if( !pMethod->pAccMsg )
|
||||
pMethod->pAccMsg = hb_dynsymGetCase( pMethod->pMessage->pSymbol->szName + 1 );
|
||||
if( hb_clsFindMsg( pClass, pMethod->pAccMsg ) )
|
||||
++nCount;
|
||||
}
|
||||
}
|
||||
@@ -4980,10 +4981,10 @@ HB_FUNC( __CLSGETPROPERTIES )
|
||||
{
|
||||
if( ( pMethod->uiScope & HB_OO_CLSTP_PERSIST ) != 0 )
|
||||
hb_arraySetC( pReturn, ++nCount, pMethod->pMessage->pSymbol->szName );
|
||||
else if( pMethod->pMessage->pSymbol->szName[ 0 ] == '_' )
|
||||
else if( pMethod->pMessage->pSymbol->szName[ 0 ] == '_' &&
|
||||
pMethod->pAccMsg )
|
||||
{
|
||||
PHB_DYNS pMsg = hb_dynsymFind( pMethod->pMessage->pSymbol->szName + 1 );
|
||||
if( pMsg && hb_clsFindMsg( pClass, pMsg ) )
|
||||
if( hb_clsFindMsg( pClass, pMethod->pAccMsg ) )
|
||||
hb_arraySetC( pReturn, ++nCount, pMethod->pMessage->pSymbol->szName + 1 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user