On 23/09/09 18:42, Markus Roberts wrote:
> > Hmm, now that I think about it, I think the issue was with the CASE,
>
> specifically this:
>
> case $variable {
> "something": {
> $othervar = 4096 / 2
> },
> /regex/: {
> notice("this notably sucks")
> }
> }
>
>
> As far as I can see, this is not a problem at all. REGEX is clearly
> valid after COMMA, and DIV clearly isn't.
Sorry my fault, there isn't any COMMA in case statements; I don't know
why, but I'm always tempted to add one.
Of course we can allow regex after a RBRACE.
> You can find regex directly after a NODE, a MATCH, a NOMATCH. It can be
> found [after] a possibly large number of tokens (including every
> other kind of
> tokens) after a CASE
>
>
> Huh? It looks to me like the case syntax just permits REGEX after
> LBRACE, RBRACE, or COMMA and DIV wouldn't ever be valid after any of those.
The LBRACE one is tricky because it would fail in my previous example.
> The key, I think, is to let go of the global state view and just let the
> REGEX rule decide based on the directly preceding token.
Yes, that sound like a good plan, except I'm afraid we'll have more and
more place where regex are valid/invalids (especially if expressions are
generalized in other place of the language as Thomas suggested).
--
Brice Figureau
My Blog: http://www.masterzen.fr/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---