[fpc-pascal] json numbers with leading dots

Benito van der Zander benito at benibela.de
Tue Sep 29 18:08:31 CEST 2020


Hi,
there are also two lines in the json scanner where it tries to repair 
numbers with leading dots '.123' to '0.123':

          If (FCurTokenString[1]='.') then
           FCurTokenString:='0'+FCurTokenString;

They should probably be removed. Not only are those numbers invalid in 
json, it is also very slow to allocate a new string. And StrToFloat 
works with '.123', so it should not change anything.

Although removing them would break programs that cannot handle '.123', 
they are broken anyways, because it is not adding a zero to  '-.123'.


Best,
Benito
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200929/f4fe619e/attachment.htm>


More information about the fpc-pascal mailing list