Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rakudo parsefails on adverbial blocks #76

Closed
p6rt opened this issue May 7, 2008 · 8 comments
Closed

Rakudo parsefails on adverbial blocks #76

p6rt opened this issue May 7, 2008 · 8 comments

Comments

@p6rt
Copy link

p6rt commented May 7, 2008

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

Searchable as RT53804$

@p6rt
Copy link
Author

p6rt commented May 7, 2008

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 &lt;=&gt; $^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
Copy link
Author

p6rt commented May 7, 2008

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 &lt;=&gt; $^b} is an
adverbial block (see S02).

So, I'm guessing the :{...} should be parsed by the
<postcircumfix> option of the <colonpair> rule​:

  token colonpair {
  '​:'
  [
  | '!' <ident> {*} #= false
  | <ident> $<val>=[ <.unsp>? <postcircumfix> ]? {*} #= value
  | <postcircumfix> {*} #= structural
  | <sigil> <twigil>? <desigilname> {*} #= varname
  ]
  }

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

Pm

@p6rt
Copy link
Author

p6rt commented May 7, 2008

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

@p6rt
Copy link
Author

p6rt commented Aug 16, 2008

From @obra

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

@p6rt
Copy link
Author

p6rt commented Mar 20, 2010

From @masak

$ perl6 -e 'my @​array = 1, 2, 3; say @​array.min​:{ $^a &lt;=&gt; $^b }'
Method 'min​:{ $^a &lt;=&gt; $^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
Copy link
Author

p6rt commented May 29, 2012

From @diakopter

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

$ perl6 -e 'my @​array = 1, 2, 3; say @​array.min​:{ $^a &lt;=&gt; $^b }'
Method 'min​:{ $^a &lt;=&gt; $^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 <diakopter> r​: my @​array = 1, 2, 3; say @​array.min​:{ $^a &lt;=&gt; $^b }
16​:55 <p6eval> rakudo 024843​: OUTPUT«1␤»

@p6rt
Copy link
Author

p6rt commented May 30, 2012

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 &lt;=&gt; $^b }'
Method 'min​:{ $^a &lt;=&gt; $^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 <diakopter> r​: my @​array = 1, 2, 3; say @​array.min​:{ $^a &lt;=&gt; $^b
}
16​:55 <p6eval> rakudo 024843​: OUTPUT«1␤»

added a test in ed219b0. Resolving.

@p6rt
Copy link
Author

p6rt commented May 30, 2012

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

@p6rt p6rt closed this as completed May 30, 2012
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant