Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Rakudo parsefails on adverbial blocks #76

Closed p6rt closed 12 years ago

p6rt commented 16 years ago

Migrated from rt.perl.org#53804 (status was 'resolved')

Searchable as RT53804$

p6rt commented 16 years ago

From @tene

Both rakudo's grammar and STD.pm have this line in token methodop​:

  | '​:' \<?before \s> \<!{ $+inquote }> \<EXPR(%list_prefix)>

t/spec/S29-list/minmax.t has the following parse failure in a few places, though​:

  is @​array.min​:{ $^a \<=> $^b }, -9,

This doesn't parse because there's no whitespace after the :

Is the test wrong? Should I update the test to match the grammar or the grammar to match the test?

p6rt commented 16 years ago

From @pmichaud

On Tue, May 06, 2008 at 11​:35​:20PM -0700, Stephen Weeks wrote​:

Both rakudo's grammar and STD.pm have this line in token methodop​:

| '&#8203;:' \<?before \\s> \<\!\{ $\+inquote \}> \<EXPR\(%list\_prefix\)>

t/spec/S29-list/minmax.t has the following parse failure in a few places, though​:

is @&#8203;array\.min&#8203;:\{ $^a \<=> $^b \}, \-9,

This doesn't parse because there's no whitespace after the :

According to TimToady on #perl6, :{ $^a \<=> $^b} is an adverbial block (see S02).

So, I'm guessing the :{...} should be parsed by the \ option of the \ rule​:

  token colonpair {   '​:'   [   | '!' \ {*} #= false   | \ $\=[ \<.unsp>? \ ]? {*} #= value   | \ {*} #= structural   | \ \? \ {*} #= varname   ]   }

We may still need to find out what causes the parsefail in Rakudo, though.

Pm

p6rt commented 16 years ago

The RT System itself - Status changed from 'new' to 'open'

p6rt commented 16 years ago

From @obra

- Needs update to grammar, may need to wait for LTM in PGE

p6rt commented 14 years ago

From @masak

$ perl6 -e 'my @​array = 1, 2, 3; say @​array.min​:{ $^a \<=> $^b }' Method 'min​:{ $^a \<=> $^b }' not found for invocant of class 'Array' [...]

Seems now Rakudo considers the colon and the block to be part of the method name. Still wrong, but in a more hopeful way, p'haps.

p6rt commented 12 years ago

From @diakopter

On Sat Mar 20 09​:42​:27 2010, masak wrote​:

$ perl6 -e 'my @​array = 1, 2, 3; say @​array.min​:{ $^a \<=> $^b }' Method 'min​:{ $^a \<=> $^b }' not found for invocant of class 'Array' [...]

Seems now Rakudo considers the colon and the block to be part of the method name. Still wrong, but in a more hopeful way, p'haps.

seems fixed now. marking testneeded.

16​:55 \ r​: my @​array = 1, 2, 3; say @​array.min​:{ $^a \<=> $^b } 16​:55 \ rakudo 024843​: OUTPUT«1␤»

p6rt commented 12 years ago

From @diakopter

On Tue May 29 14​:55​:53 2012, diakopter wrote​:

On Sat Mar 20 09​:42​:27 2010, masak wrote​:

$ perl6 -e 'my @​array = 1, 2, 3; say @​array.min​:{ $^a \<=> $^b }' Method 'min​:{ $^a \<=> $^b }' not found for invocant of class 'Array' [...]

Seems now Rakudo considers the colon and the block to be part of the method name. Still wrong, but in a more hopeful way, p'haps.

seems fixed now. marking testneeded.

16​:55 \ r​: my @​array = 1, 2, 3; say @​array.min​:{ $^a \<=> $^b } 16​:55 \ rakudo 024843​: OUTPUT«1␤»

added a test in ed219b0. Resolving.

p6rt commented 12 years ago

@diakopter - Status changed from 'open' to 'resolved'