qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* qapi-schema esotera
@ 2020-08-03 16:49 John Snow
  2020-08-03 17:25 ` Eric Blake
  0 siblings, 1 reply; 6+ messages in thread
From: John Snow @ 2020-08-03 16:49 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: QEMU Developers

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



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

end of thread, other threads:[~2020-08-05  8:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-03 16:49 qapi-schema esotera John Snow
2020-08-03 17:25 ` 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

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).