Eric Blake <[email protected]> writes:

> On 07/26/2013 06:39 AM, Markus Armbruster wrote:
>> The parser handles erroneous input badly.  To be improved shortly.
>> 
>> Signed-off-by: Markus Armbruster <[email protected]>
>> ---
>
> Lots of proof on how bad it is!  I'd also like to see a couple tests on
> trailing commas:
>
> { 'enum': 'Foo', [ 'bar' ], }
> { 'enum': 'Gur', [ 'ble', ] }

I figure you mean

{ 'enum': 'Foo', 'data': [ 'bar' ], }
{ 'enum': 'Gur', 'data': [ 'ble', ] }

My parser rejects both:

<stdin>:1:37: Expected string
<stdin>:2:35: Expected "{", "[" or string

I commented out the first to get the second error.  Making the parser
continue after errors didn't seem to be worthwhile.

> since we have had patches in the past to clean them up (shame on JSON
> for copying C89 instead of C99 with regards to trailing commas).

Indeed.

> Either way,
>
> Reviewed-by: Eric Blake <[email protected]>

Thanks!

Reply via email to