On 9/13/19 10:39 AM, Markus Armbruster wrote: >>> + expression A; expression A, ... likewise, but separated by , >> >> worth calling out that trailing , are not allowed? > > Doesn't "separated by" imply that? > >> Is the 'expression A;' a copy-paste from RFC text, irrelevant to our >> usage here? > > What about > > * Repetition: Expression A... matches zero or more occurences of > expression A > * Repetition: Expression A, ... matches zero or more occurences of > expression A separated by ,
With the spelling of 'occurrences' fixed, that works. >>> +The top-level expressions are all JSON objects. Their order does not >>> +matter. >> >> Is that always true for all directives? > > Yes from a purely semantic point of view. > > No when you look at the generated text: that's in source order. Should > not matter for C. Does matter for documentation. > > See also discussion of previous patch. > >> Would it be worth reformulating as something like: >> >> SCHEMA = DIRECTIVE... DEFINITION... >> >> allowing zero-or-more of either, but where directives come first? > > Language change. Not sure anything outside tests would break. But why > bother? Fair enough. >>> +Each BRANCH of the 'data' object defines a branch of the union. A >>> +union must have at least one branch. >> >> Is it worth trying to represent one-or-more in the grammar, in a >> different manner than zero-or-more? > > If we needed it multiple times, then something like > > * Repetition: Expression A * matches zero or more occurences of > expression A > * Repetition: Expression A, * matches zero or more occurences of > expression A separated by , > * Repetition: Expression A + matches one or more occurences of > expression A > * Repetition: Expression A, + matches one or more occurences of > expression A separated by , > > could be helpful. But I can't see the need right now. Again with the typo. But I also agree that it's not needed right now. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature