> > > > > > 3) Exchange '>' to '::' > > > little more performance expensive > > > > Why exactly "::" would have any performance problem? > > only comparison of char and multiple char and more one if many times.
I think it's premature optimization. Also, long term we should aim at replacing the cartesian parser's string manipulation with a lexer & parser. Then this will not be a problem. But if we can find a better notation like the bracketed one you propose below, even better. > > > > > > > only host_os::linux2 should work > > > host_os::linux1: var = 2 could work but > > > host_os::linux1: work but > > > var1 = 2 > > > > > > 4) Exchange '>' to '-' > > > > > > only host_os-linux2 should work > > > host_os-linux1: var = 2 could work but not good visible > > > > What "not good visible" means? > > If you have lots of > > host_os-guest1.virt_os-linux.sdff-aaaaa. > > Then it could be hard to see in first sight in logs. could be hidden in text. > And as you wrote before looks like part of name. I agree. > > > host_os-linux1: > > > var1 = 2 > > > > > > Which of this version do you prefer most or do you prefer some different > > > version? > > > > So, the main problem here seems to be how to make the "<condition>:" > > blocks look good and intuitive. > > > > The answer is: I don't know! I need to think about it a little. > > Currently I see two main possible approaches: > > > > * The ones you proposed above (Use something else than "="). > > I believe any of ":", "::" or "-" look better than ">". I think I > > would choose "::". ":" is confusing (see my comment above), "-" > > doesn't look like an "operator", but just part of the variant name. ":" is confusing in the grammar, I agree. > > * Require some kind of delimiter when "=" is involved. e.g.: > > only [host_os=linux2] > > [host_os=linux2]: var = 2 > > [host_os=linux2]: > > var = 2 > > [host_os == "linux2"]: var = 2 > > > > I would love to hear suggestions from others as well. Paolo? > > I like this version. It could be easy and fast for parsing. And good visible. > only [host_os=linux2] > [host_os=linux2]: var = 2 > [host_os=linux2]: > var = 2 > > disadvantage: This breaks today syntax. There could be choice > for named variant and filtering with name in config have to be > > only [host_os=linux2] > > for unnamed it could stay as it for keep compatibility. > > only linux2 > but could be replaced by > only [linux2] What about "only Fedora.17"? Would it be valid to write it as "only [Fedora].[17]"? It is indeed an interesting proposal. > > only [host_os=linux2.guest_os] > or > only linux2.guest_os > > > host_os=linux2.guest_os: this will be interpreted like variable > assignation. > [host_os=linux2.guest_os]: condition. > > It could be little confusing for users.. No, it's ok. We could retroactively define filters to be bracket-delimited, with the brackets optional for simple identifiers. > This version is quite overkill from my point of view. > [host_os == "linux2"]: var = 2 Without quotes, I think. Like [host_os == linux2]. Paolo _______________________________________________ Virt-test-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/virt-test-devel
