Re: [Qemu-devel] [PATCH 41/56] json: Nicer recovery from invalid leading zero

2018-08-14 Thread Eric Blake
On 08/14/2018 03:24 AM, Markus Armbruster wrote: Should IN_BAD_ZERO also consume '.' and/or 'e' (after all, '01e2 is a valid C constant, but not a valid JSON literal)? But I think your choice here is fine (again, add too much, and then the lexer has to track a lot of state; whereas this minimal

Re: [Qemu-devel] [PATCH 41/56] json: Nicer recovery from invalid leading zero

2018-08-14 Thread Markus Armbruster
Eric Blake writes: > On 08/08/2018 07:03 AM, Markus Armbruster wrote: >> For input 0123, the lexer produces the tokens >> >> JSON_ERROR01 >> JSON_INTEGER 23 >> >> Reporting an error is correct; 0123 is invalid according to RFC 7159. >> But the error recovery isn't nice. >> >> Make

Re: [Qemu-devel] [PATCH 41/56] json: Nicer recovery from invalid leading zero

2018-08-13 Thread Eric Blake
On 08/08/2018 07:03 AM, Markus Armbruster wrote: For input 0123, the lexer produces the tokens JSON_ERROR01 JSON_INTEGER 23 Reporting an error is correct; 0123 is invalid according to RFC 7159. But the error recovery isn't nice. Make the finite state machine eat digits before go