Jira (PUP-4464) 4.x syntax error in '=>' in hash following another expression
Title: Message Title Henrik Lindberg commented on PUP-4464 Re: 4.x syntax error in '=>' in hash following another _expression_ I am going to close this a a won't fix as there are several ways to work around this problem and the cost (if at all possible) trying to fix this is very high. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4464) 4.x syntax error in '=>' in hash following another expression
Title: Message Title Henrik Lindberg commented on PUP-4464 Re: 4.x syntax error in '=>' in hash following another _expression_ Note that the hint may not work on older versions, as we only recently made it possible for the parser to differentiate parentheses following an _expression_ from being a call from (as in the post above just an _expression_ grouping) when there is a newline between the _expression_ and the opening parenthesis. The last example can be written: $result = $rows.map |$row| { $temp_val = $row['col'] ; # note the semicolon here { a=> $temp_val } } Where a semicolon separates the expressions and removes the ambiguity. Here the parentheses should work (cannot be misinterpreted as a call). ({ 'if_eth0' => 'if_', 'if_err_eth0' => 'if_err_', }).each |$plugin, $target| {
Jira (PUP-4464) 4.x syntax error in '=>' in hash following another expression
Title: Message Title Andrey Galkin commented on PUP-4464 Re: 4.x syntax error in '=>' in hash following another _expression_ Just a hint for anyone running into the problem. Adding round brackets around Hash should help. Example (not tested). $result = $rows.map |$row| { $temp_val = $row['col'] ({ a=> $temp_val }) } Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from t
Jira (PUP-4464) 4.x syntax error in '=>' in hash following another expression
Title: Message Title Russell Mull commented on PUP-4464 Re: 4.x syntax error in '=>' in hash following another _expression_ I just ran into a similar situation when trying to bind some variables inside a `map` {{$result = $rows.map |$row| { $temp_val = $row['col'] { a=> $temp_val } }}} This gave me an error like this: {{2016-07-28 00:16:01,405 ERROR [qtp366178702-63] [puppetserver] Puppet Evaluation Error: Error while evaluating a Resource Statement, _expression_ is not valid as a resource, resource-default, or resource-override at /opt/puppetlabs/puppet/modules/puppet_enterprise/manifests/cli_config.pp:74:14 on node mom .dev}} This is a pretty icky piece of ambiguity. Perhaps we could provide a hint in the error message, in the cases where we know it can happen? Add Comment This message was sent by Atlassian JIRA (v6.4.13#64028-sha1:b7939e9) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4464) 4.x syntax error in '=>' in hash following another expression
Title: Message Title Henrik Lindberg commented on PUP-4464 Re: 4.x syntax error in '=>' in hash following another _expression_ Unfortunately, the grammar for resource expressions is highly ambiguous and there are already many tricks used to make it reasonably behaved (including parsing one way, and the rewriting the result). This is not an easy problem to fix as it requires look ahead beyond what the racc based parser generator is capable of. Add Comment This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-4464) 4.x syntax error in '=>' in hash following another expression
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-4464 4.x syntax error in '=>' in hash following another _expression_ Change By: Henrik Lindberg Summary: 4.x parser bug with anonymous data structures syntax error in '=>' in hash following another _expression_ Add Comment This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d) -- 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 puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.