Re: [fpc-pascal] json parsing: detecting invalid escape sequences

2020-09-29 Thread Michael Van Canneyt via fpc-pascal
On Tue, 29 Sep 2020, Benito van der Zander via fpc-pascal wrote: Hi, I am supposed to find invalid escape sequences when parsing JSON and replace them with a user defined fallback. Invalid in the sense that the unicode codepoint is not defined or a missing surrogate, not syntactically inval

[fpc-pascal] json parsing: detecting invalid escape sequences

2020-09-29 Thread Benito van der Zander via fpc-pascal
Hi, I am supposed to find invalid escape sequences when parsing JSON and replace them with a user defined fallback. Invalid in the sense that the unicode codepoint is not defined or a missing surrogate, not syntactically invalid. For example, any occurrence of \u and \uDEAD should be rep

[fpc-pascal] json numbers with leading dots

2020-09-29 Thread Benito van der Zander via fpc-pascal
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 a

Re: [fpc-pascal] json parser line numbers

2020-09-29 Thread Benito van der Zander via fpc-pascal
here: https://bugs.freepascal.org/view.php?id=37836 On 29.09.20 10:47, Michael Van Canneyt via fpc-pascal wrote: On Tue, 29 Sep 2020, Benito van der Zander via fpc-pascal wrote: Hi, the line numbering of the json parser has been changed recently. It used to say "Error at line 1"... when

Re: [fpc-pascal] json parser line numbers

2020-09-29 Thread Michael Van Canneyt via fpc-pascal
On Tue, 29 Sep 2020, Benito van der Zander via fpc-pascal wrote: Hi, the line numbering of the json parser has been changed recently. It used to say "Error at line 1"... when there was an error in the first line, but now it says "Error at line 0"... Was that on purpose, or can someone cha

[fpc-pascal] json parser line numbers

2020-09-29 Thread Benito van der Zander via fpc-pascal
Hi, the line numbering of the json parser has been changed recently. It used to say "Error at line 1"... when there was an error in the first line, but now it says "Error at line 0"... Was that on purpose, or can someone change it back? Benito ___