Răsfoiți Sursa

qapi: Fix a misleading parser error message

When choking on a token where an expression is expected, we report
'Expected "{", "[" or string'.  Close, but no cigar.  Fix it to
Expected '"{", "[", string, boolean or "null"'.

Missed in commit e53188a.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <1489582656-31133-48-git-send-email-armbru@redhat.com>
Markus Armbruster 8 ani în urmă
părinte
comite
012b126de2
2 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 2 1
      scripts/qapi.py
  2. 1 1
      tests/qapi-schema/trailing-comma-list.err

+ 2 - 1
scripts/qapi.py

@@ -519,7 +519,8 @@ def get_expr(self, nested):
             expr = self.val
             self.accept()
         else:
-            raise QAPIParseError(self, 'Expected "{", "[" or string')
+            raise QAPIParseError(self, 'Expected "{", "[", string, '
+                                 'boolean or "null"')
         return expr
 
     def get_doc(self, info):

+ 1 - 1
tests/qapi-schema/trailing-comma-list.err

@@ -1 +1 @@
-tests/qapi-schema/trailing-comma-list.json:2:36: Expected "{", "[" or string
+tests/qapi-schema/trailing-comma-list.json:2:36: Expected "{", "[", string, boolean or "null"