qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qapi: Fix parse errors for removal of null from schema language
@ 2021-02-24 10:14 Markus Armbruster
  2021-02-24 13:34 ` Eric Blake
  2021-02-24 21:15 ` John Snow
  0 siblings, 2 replies; 3+ messages in thread
From: Markus Armbruster @ 2021-02-24 10:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: michael.roth, jsnow

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>
---
 scripts/qapi/parser.py                    | 8 ++++----
 tests/qapi-schema/leading-comma-list.err  | 2 +-
 tests/qapi-schema/trailing-comma-list.err | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
index e7b9d670ad..116afe549a 100644
--- a/scripts/qapi/parser.py
+++ b/scripts/qapi/parser.py
@@ -236,9 +236,9 @@ def get_values(self):
         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 @@ def get_expr(self, nested):
         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):
diff --git a/tests/qapi-schema/leading-comma-list.err b/tests/qapi-schema/leading-comma-list.err
index 76eed2b5b3..0725d6529f 100644
--- a/tests/qapi-schema/leading-comma-list.err
+++ b/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
diff --git a/tests/qapi-schema/trailing-comma-list.err b/tests/qapi-schema/trailing-comma-list.err
index ad2f2d7c97..bb5f8c3c90 100644
--- a/tests/qapi-schema/trailing-comma-list.err
+++ b/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
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] qapi: Fix parse errors for removal of null from schema language
  2021-02-24 10:14 [PATCH] qapi: Fix parse errors for removal of null from schema language Markus Armbruster
@ 2021-02-24 13:34 ` Eric Blake
  2021-02-24 21:15 ` John Snow
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2021-02-24 13:34 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: michael.roth, jsnow

On 2/24/21 4:14 AM, Markus Armbruster wrote:
> 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>
> ---
>  scripts/qapi/parser.py                    | 8 ++++----
>  tests/qapi-schema/leading-comma-list.err  | 2 +-
>  tests/qapi-schema/trailing-comma-list.err | 2 +-
>  3 files changed, 6 insertions(+), 6 deletions(-)

My first reaction was "How does our 'StrOrNull' alternate type work?
But I see that uses 'null' (that is, a string type name, just like 'str'
or 'int'), and not a literal null.  At which point this makes total sense.

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] qapi: Fix parse errors for removal of null from schema language
  2021-02-24 10:14 [PATCH] qapi: Fix parse errors for removal of null from schema language Markus Armbruster
  2021-02-24 13:34 ` Eric Blake
@ 2021-02-24 21:15 ` John Snow
  1 sibling, 0 replies; 3+ messages in thread
From: John Snow @ 2021-02-24 21:15 UTC (permalink / raw)
  To: Markus Armbruster, qemu-devel; +Cc: michael.roth

On 2/24/21 5:14 AM, Markus Armbruster wrote:
> Commit 9d55380b5a "qapi: Remove null from schema language" (v4.2.0)
> neglected to update two error messages.  Do that now.
> 

One less patch in part 5.

Reviewed-by: John Snow <jsnow@redhat.com>

> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   scripts/qapi/parser.py                    | 8 ++++----
>   tests/qapi-schema/leading-comma-list.err  | 2 +-
>   tests/qapi-schema/trailing-comma-list.err | 2 +-
>   3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py
> index e7b9d670ad..116afe549a 100644
> --- a/scripts/qapi/parser.py
> +++ b/scripts/qapi/parser.py
> @@ -236,9 +236,9 @@ def get_values(self):
>           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 @@ def get_expr(self, nested):
>           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):
> diff --git a/tests/qapi-schema/leading-comma-list.err b/tests/qapi-schema/leading-comma-list.err
> index 76eed2b5b3..0725d6529f 100644
> --- a/tests/qapi-schema/leading-comma-list.err
> +++ b/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
> diff --git a/tests/qapi-schema/trailing-comma-list.err b/tests/qapi-schema/trailing-comma-list.err
> index ad2f2d7c97..bb5f8c3c90 100644
> --- a/tests/qapi-schema/trailing-comma-list.err
> +++ b/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
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-24 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-24 10:14 [PATCH] qapi: Fix parse errors for removal of null from schema language Markus Armbruster
2021-02-24 13:34 ` Eric Blake
2021-02-24 21:15 ` John Snow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).