Gentoo Archives: gentoo-dev

From: Dirkjan Ochtman <djc@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: Gentoo Development <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] New schema language for metadata validation?
Date: Wed, 27 Jan 2016 16:18:16
Message-Id: CAKmKYaCJ9wFPiZoSE2duM=r71squU9XT_=8Gn7g6V8i8hecFow@mail.gmail.com
In Reply to: Re: [gentoo-dev] New schema language for metadata validation? by "Michał Górny"
1 On Wed, Jan 27, 2016 at 4:43 PM, Michał Górny <mgorny@g.o> wrote:
2 > Yes, that part makes some sense. Except that it immediately follows
3 > braces which makes me think it applies only to the thing in the braces.
4 > Furthermore, the use of {} vs () seems pretty much random, and the &
5 > is completely unclear what it could mean (I'm not reading the docs
6 > here!). I look at it and I wonder if that forces some ordering or not,
7 > if it supports interspersing or not. And finally, the fact that '*'
8 > follows closing brace on the other end of file does not help
9 > readability.
10
11 A full expression runs from a keyword to the closing brace (e.g.
12 "element <name> { }"). Parentheses are only used to group expressions
13 that have the infix operators (one of "," for concatenate -- e.g.,
14 order --, "|" -- alternative -- and "&" -- interleaving), because
15 there's no implicit precedence order. Yes, the quantizer comes at the
16 end. On the other hand, you could rewrite the large expression to be a
17 named pattern, and then put the quantization after the pattern name if
18 you prefer that style. That would probably make more sense for large
19 named patterns. :)
20
21 Cheers,
22
23 Dirkjan