Browse Source

qapi: Fix parse errors for removal of null from schema language

Commit 9d55380b5a "qapi: Remove null from schema language" (v4.2.0)
neglected to update two error messages.  Do that now.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210224101442.1837475-1-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
pull/198/head
Markus Armbruster 5 years ago
parent
commit
0e92a19b8c
  1. 8
      scripts/qapi/parser.py
  2. 2
      tests/qapi-schema/leading-comma-list.err
  3. 2
      tests/qapi-schema/trailing-comma-list.err

8
scripts/qapi/parser.py

@ -236,9 +236,9 @@ class QAPISchemaParser:
if self.tok == ']':
self.accept()
return expr
if self.tok not in "{['tfn":
if self.tok not in "{['tf":
raise QAPIParseError(
self, "expected '{', '[', ']', string, boolean or 'null'")
self, "expected '{', '[', ']', string, or boolean")
while True:
expr.append(self.get_expr(True))
if self.tok == ']':
@ -257,12 +257,12 @@ class QAPISchemaParser:
elif self.tok == '[':
self.accept()
expr = self.get_values()
elif self.tok in "'tfn":
elif self.tok in "'tf":
expr = self.val
self.accept()
else:
raise QAPIParseError(
self, "expected '{', '[', string, boolean or 'null'")
self, "expected '{', '[', string, or boolean")
return expr
def get_doc(self, info):

2
tests/qapi-schema/leading-comma-list.err

@ -1 +1 @@
leading-comma-list.json:2:13: expected '{', '[', ']', string, boolean or 'null'
leading-comma-list.json:2:13: expected '{', '[', ']', string, or boolean

2
tests/qapi-schema/trailing-comma-list.err

@ -1 +1 @@
trailing-comma-list.json:2:36: expected '{', '[', string, boolean or 'null'
trailing-comma-list.json:2:36: expected '{', '[', string, or boolean

Loading…
Cancel
Save