On 13/02/11 00:22, Daniel Pittman wrote:
> On Sat, Feb 12, 2011 at 14:29, Brice Figureau
> <[email protected]> wrote:
>> On 12/02/11 21:44, Daniel Pittman wrote:
>>> On Sat, Feb 12, 2011 at 08:36, Brice Figureau
>>> <[email protected]> wrote:
>>>
>>>> The following manifest was producing a parse error:
>>>> $int = { 'eth0' => 'bla' }
>>>> $foo = $int['eth0'] ? {
>>>>  'bla' => 'foo',
>>>>   default => 'bleh'
>>>> }
>>>>
>>>> because selectors didn't support hash access.
>>>
>>> After merging the proposed change in, I get a test failure on my machine:
>>>
>>>   1) Puppet::Parser when parsing selector should support hash access
>>> on the left hand side
>>>      Failure/Error: lambda { @parser.parse("$h = { 'a' => 'b' }\n$a =
>>> $h['a'] ? { 'b' => 'd', default => undef }") }.should_not raise_error
>>>        expected no Exception, got #<Puppet::ParseError: Syntax error
>>> at '?' at line 2>
>>>      # ./spec/unit/parser/parser_spec.rb:81
>>>
>>> ⚡ git log --oneline -1
>>> 683bd17 Merge branch 'masterzen/tickets/2.6.x/5516' into
>>> bug/2.6.next/5516-hashes-can't-be-used-in-selectors
>>>
>>> It isn't entirely clear to me why this fails, and I don't have time to
>>> investigate further this second, but a simple merge to 2.6.next
>>> doesn't fix the problem on my machine.
>>
>> Did you merge from the patch I sent here or from my github branch?
> 
> From your github branch.  I got the 841 changes to the parser.rb file,
> and after redoing that to make sure I still get the same result.
> (masterzen/tickets/2.6.x/5516 is your branch, pulled into my
> repository.)
> 
>> I removed the auto-generated parser.rb from the patch I sent to the list
>> so that it can be read more easily. You need to rebuild the parser.rb
>> file from the grammar:
>> touch lib/puppet/parser/grammar.ra
>> make -C lib/puppet/parser
> 
> Hrm.  So, it turns out that merging your github branch fails, but
> rebuilding the grammer with racc 1.4.6 works on my test system.  Now
> it passes that test, so I can merge the outcome of that rebuild.
> Thanks for the hint: I should have tried that earlier, I guess, before
> giving up.

That's the issue when doing grammar modifications: either I do them
serially (each one on top of the others) and you need to apply them in
order, or I do them independantly but you'd need to rebuild parser.rb
after every merge.

There's no good solutions to this problem, though. Except I don't think
we should have parser.rb in git. But it's so more convenient this way
for our users (they don't have anything to build when they git clone).
-- 
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.

Reply via email to