OSDN Git Service

qapi/parser: Assert lexer value is a string
authorJohn Snow <jsnow@redhat.com>
Wed, 19 May 2021 18:39:41 +0000 (14:39 -0400)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 20 May 2021 09:28:27 +0000 (11:28 +0200)
commit7c610ce6a9950a49148fc3d37ed353958ca8d776
tree4e5af55a52a26bd9805334c41e07d2aeb7a1e643
parent16ff40acc9c1fc871c2c835b3b20e374d6daed98
qapi/parser: Assert lexer value is a string

The type checker can't narrow the type of the token value to string,
because it's only loosely correlated with the return token.

We know that a token of '#' should always have a "str" value.
Add an assertion.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20210519183951.3946870-6-jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/parser.py