[fpc-devel] Patch for bug 3774

Thomas Schatzl tom_at_work at gmx.at
Sat Apr 2 17:11:30 CEST 2005


Florian Klaempfl schrieb:
> Thomas Schatzl wrote:
> 
>>Sterling Bates schrieb:
>>
>>>This patch adds recognition for hex to Val().
> 
> 
> Applied.
> 
> What about the extended (?) pascal convention 16#ffff ?

Done. =)

But until asking you to have a look at it, I've some questions:

- for non-64 bit CPUs there's a fpc_val_int64_shortstr and
fpc_val_qword_shortstr helper function in sstrings.inc in addition to
some note indicating problems with 1.0.10.
Are these two helper functions still needed in 1.9.x? (Since it's a
"feature" it will possible not be added until 2.0 anyway, so I'm asking
if I could skip these two methods?)
I mean, with 1.9.x compilers the hacks used there should not be
necessary... (I think)

- signs for non-base 10 numbers: should they be allowed or not? E.g.
Delphi allows -0x1234, -$1234 etc. At the moment this is implemented.
The only problem is -$80000000.... (Delphi gives -2147...)

- I implemented this feature according to the ebnf for Extended Pascal
(http://www.fh-jena.de/~gmueller/Kurs_halle/pas_extp.html),
"extended-number" nonterminal. This allows leading zeros in front of the
base specifier; is this ok?
E.g. 0000000012#1234 is the same as 12#1234.
Since the sign is not included in this rule, I simply added it at the
front of the number, e.g. -12#1234, not 12#-1234 (which may be
possible). Don't have a compiler available, and I think the former is
better anyway, but is that ok?

- I fixed some other bugs in the current implementation, especially with
edge values (e.g. $ffffffff with Cardinals). Hope this is ok =) =)

Regards,
   Thomas





More information about the fpc-devel mailing list