Issue #21608 has been updated by Chris Wilson.
OK, at least the error message is better than the original one, which we found
very funny in the office.
But I still think that, at least in theory, during parsing there should be two
options after the "]": either a ":" or a "=>". Anything else would be a parser
error. (Assuming that the lexer has separated the input into tokens and thrown
away any white space, then the parser doesn't need to account for that
possibility). If the parser was able to present a list of the valid options,
that would have helped a lot.
I still find the value "syntax error" pretty useless. Surely there is more than
one class of syntax error? How on earth is one supposed to resolve it, apart
from commenting things out until it stops breaking?
Why does the parser even consider the possibility of a function call? I assume
that parentheses areound the expression are absolutely requires, and there are
no parentheses here. It was an option between "f" and "{", but after seeing "{"
it's no longer an option.
----------------------------------------
Bug #21608: Syntax error at '}'; expected '}'
https://projects.puppetlabs.com/issues/21608#change-97779
* Author: Chris Wilson
* Status: Closed
* Priority: Normal
* Assignee: Henrik Lindberg
* Category: language
* Target version:
* Affected Puppet version: 2.6.18
* Keywords: parser errors
* Branch:
----------------------------------------
>From the following code:
<pre>
#
http://stackoverflow.com/questions/6399922/are-there-iterators-and-loops-in-puppet
define f {
file { "/root/.ssh/${title}":
ensure => present,
source => 'puppet:///files/ssh_keys/${title}',
owner => 'root', group => 'root', mode => '0400',
}
}
f { ["id_beep_down", "id_beep_down.pub", "id_beep_up", "id_beep_up.pub",] }
</pre>
I think it's missing a colon after the last ], but that's not what the error
message says.
<pre>
[puppet server]$ rpm -q puppet
puppet-2.6.18-3.el6.noarch
</pre>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.