Received: from eggs.gnu.org ([2001:4830:134:3::10]:37363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2ion-0003N5-76 for qemu-devel@nongnu.org; Fri, 26 Jul 2013 10:16:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2iom-00010N-1I for qemu-devel@nongnu.org; Fri, 26 Jul 2013 10:16:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2iol-000102-QK for qemu-devel@nongnu.org; Fri, 26 Jul 2013 10:16:27 -0400 From: Markus Armbruster References: <1374842387-17146-1-git-send-email-armbru@redhat.com> <1374842387-17146-2-git-send-email-armbru@redhat.com> <51F27021.60905@redhat.com> Date: Fri, 26 Jul 2013 16:16:23 +0200 In-Reply-To: <51F27021.60905@redhat.com> (Eric Blake's message of "Fri, 26 Jul 2013 06:48:33 -0600") Message-ID: <87bo5pl83s.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 1/9] tests: QAPI schema parser tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: aliguori@us.ibm.com, akong@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com Eric Blake 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 >> --- > > 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: :1:37: Expected string :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 Thanks!