On Thu, Feb 17, 2011 at 2:11 PM, Luke Kanies <[email protected]> wrote:

> This looks more like a lexer problem than a parser problem to me.
>
> Negative numbers should be lexed the same as positive numbers, because
> otherwise you have to go in and specifically allow negative numbers
> everywhere.
>
> In the current solution, you have enabled negative numbers for functions,
> but not for parameter values:
>
> file { "/tmp/asdf": owner => -1 }
>
> That throws a parse exception.
>
> Note that there's an easy workaround:
>
> file { "/tmp/asdf": owner => "-1" }
>
> This works just fine with functions, too (given that Puppet's language only
> has strings, no numbers).
>

It's true that this solution doesn't fix that problem. But it does fix the
problem of not being able to call my_function(-$a), which has a more
challenging workaround. A solution that would have solved both related
problems would be more complex, and didn't feel appropriate for a fix
targeting 2.6. In the future, there are a whole host of related lexer/parser
issues I would like to address, including #5817, #5516, #5268, #3129.

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

Reply via email to