From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbAdB-00082M-Ix for qemu-devel@nongnu.org; Thu, 26 Mar 2015 12:27:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbAd6-00055j-Ch for qemu-devel@nongnu.org; Thu, 26 Mar 2015 12:27:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbAd6-00055C-80 for qemu-devel@nongnu.org; Thu, 26 Mar 2015 12:27:36 -0400 From: Markus Armbruster References: <1427227433-5030-1-git-send-email-eblake@redhat.com> <1427227433-5030-15-git-send-email-eblake@redhat.com> Date: Thu, 26 Mar 2015 17:27:32 +0100 In-Reply-To: <1427227433-5030-15-git-send-email-eblake@redhat.com> (Eric Blake's message of "Tue, 24 Mar 2015 14:03:39 -0600") Message-ID: <87fv8ryb9n.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v5 14/28] qapi: Better error messages for bad expressions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, lcapitulino@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, wenchaoqemu@gmail.com Eric Blake writes: > The previous commit demonstrated that the generator overlooked some > fairly basic broken expressions: > - missing metataype > - metatype key has a non-string value > - unknown key in relation to the metatype > - conflicting metatype (this patch treats the second metatype as an > unknown key of the first key visited, which is not necessarily the > first key the user typed) Not ideal, but good enough for a development tool. > > Add check_keys to cover these situations, and update testcases to > match. A couple other tests (enum-missing-data, indented-expr) had > to change since the validation added here occurs so early. > > While valid .json files won't trigger any of these cases, we might > as well be nicer to developers that make a typo while trying to add > new QAPI code. > > Signed-off-by: Eric Blake Reviewed-by: Markus Armbruster