qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: qapi-schema esotera
Date: Mon, 3 Aug 2020 12:49:38 -0400	[thread overview]
Message-ID: <5bfa3895-304d-8372-c0db-fda4c1a1ba59@redhat.com> (raw)

UNION is split into two primary forms:

1. Simple (No discriminator nor base)
2. Flat (Discriminator and base)

In expr.py, I notice that we modify the perceived type of the 'type' 
expression based on the two union forms.

1a. Simple unions allow Array[T]
1b. Flat unions disallow Array[T]

 From the docs:

Syntax:
     UNION = { 'union': STRING,
               'data': BRANCHES,
               '*if': COND,
               '*features': FEATURES }
           | { 'union': STRING,
               'data': BRANCHES,
               'base': ( MEMBERS | STRING ),
               'discriminator': STRING,
               '*if': COND,
               '*features': FEATURES }
     BRANCHES = { BRANCH, ... }
     BRANCH = STRING : TYPE-REF
            | STRING : { 'type': TYPE-REF, '*if': COND }

Both arms use the same "BRANCHES" grammar production, which both use 
TYPE-REF.

     TYPE-REF = STRING | ARRAY-TYPE
     ARRAY-TYPE = [ STRING ]

Implying that List[T] should be allowed for both productions.
Can I ask for a ruling from the judges?

--js



             reply	other threads:[~2020-08-03 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-03 16:49 John Snow [this message]
2020-08-03 17:25 ` qapi-schema esotera Eric Blake
2020-08-03 17:51   ` John Snow
2020-08-04  5:33     ` Markus Armbruster
2020-08-04 18:15       ` John Snow
2020-08-05  8:10         ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5bfa3895-304d-8372-c0db-fda4c1a1ba59@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).