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

STD.pm catches inadvertent block gobbling, Rakudo doesn't #1076

Closed
p6rt opened this issue Jun 20, 2009 · 10 comments
Closed

STD.pm catches inadvertent block gobbling, Rakudo doesn't #1076

p6rt opened this issue Jun 20, 2009 · 10 comments

Comments

@p6rt
Copy link

p6rt commented Jun 20, 2009

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

Searchable as RT66776$

@p6rt
Copy link
Author

p6rt commented Jun 20, 2009

From @masak

<masak> perl6​: for 1,2,3, { say $_ }
<p6eval> rakudo 1b06df​: OUTPUT«Could not find non-existent sub forâ�¤Â»
<p6eval> ..pugs​: OUTPUT«1â�¤2â�¤3â�¤Â»
<p6eval> ..elf 27154​: OUTPUT«Parse error in​: /tmp/9lN36lTpDyâ�¤panic at
line 1 column 0 (pos 0)​: Can't understand next input--giving
upâ�¤WHERE​: for 1,2,3, { say $_
  }â�¤WHERE​:/\<-- HERE [...]
<masak> arguably, Rakudo gets this one right.
<masak> but I find it fairly easy to forget to remove a trailing comma
before the block.
<TimToady> std​: for 1,2,3, { say $_ }
<p6eval> std 27154​: OUTPUT«##### PARSE FAILED #####â�¤Expression needs
parens to avoid gobbling block [...]
<masak> yes, that would help.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Aug 13, 2010

From sohtil@gmail.com

With current Rakudo​:

$ ./perl6

for 1,2,3, { say $_ }
Missing block at line 2, near ""

This is Rakudo Perl 6, version 2010.07-113-gc41bcd7 built on parrot
2.6.0 r48341

@p6rt
Copy link
Author

p6rt commented Aug 13, 2010

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

@p6rt
Copy link
Author

p6rt commented Jul 31, 2012

From @bbkr

When namespace is not defined in CATCH block it gives misleading message about missing block.

$ perl6 -e 'CATCH {when X​::Y {}}'
===SORRY!===
Missing block
at -e​:1

Tested on Rakudo star 2012.07

@p6rt
Copy link
Author

p6rt commented Aug 7, 2012

From @moritz

On Tue Jul 31 15​:18​:54 2012, pawel.pabian@​implix.com wrote​:

$ perl6 -e 'CATCH {when X​::Y {}}'
===SORRY!===
Missing block
at -e​:1

FWIW this is not related to CATCH at all. Since X​::Y is parsed as a
listop, the block is parsed as as an argument to the listop, and then
'when' misses its block. And yes, we should have a better error message
for that.

@p6rt
Copy link
Author

p6rt commented Aug 7, 2012

@moritz - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 14, 2014

From @ShimmerFairy

As of latest Rakudo​:

  $ perl6 -e 'for 1,2,3, { say $_ }'
  ===SORRY!===
  Expression needs parens to avoid taking the block
  at -e​:1
  ------> for 1,2,3, { say $_ }â��<EOL>
  Missing block (apparently taken by expression)
  at -e​:1
  ------> for 1,2,3, { say $_ }â��<EOL>

  $ perl6 -e 'CATCH { when X​::Y {} }'
  ===SORRY!===
  Function 'X​::Y' needs parens to avoid taking the block
  at -e​:1
  ------> CATCH { when X​::Y {}â�� }
  Missing block (apparently taken by 'X​::Y')
  at -e​:1
  ------> CATCH { when X​::Y {} â��}

Can be closed now, unless tests are somehow needed.

@p6rt
Copy link
Author

p6rt commented Jun 2, 2014

From @jnthn

On Thu Mar 13 19​:14​:31 2014, lue wrote​:

As of latest Rakudo​:

$ perl6 \-e 'for 1,2,3, \{ say $\_ \}'
===SORRY\!===
Expression needs parens to avoid taking the block
at \-e&#8203;:1
\-\-\-\-\-\-> for 1,2,3, \{ say $\_ \}�\<EOL>
Missing block \(apparently taken by expression\)
at \-e&#8203;:1
\-\-\-\-\-\-> for 1,2,3, \{ say $\_ \}�\<EOL>


$ perl6 \-e 'CATCH \{ when X&#8203;::Y \{\} \}'
===SORRY\!===
Function 'X&#8203;::Y' needs parens to avoid taking the block
at \-e&#8203;:1
\-\-\-\-\-\-> CATCH \{ when X&#8203;::Y \{\}� \}
Missing block \(apparently taken by 'X&#8203;::Y'\)
at \-e&#8203;:1
\-\-\-\-\-\-> CATCH \{ when X&#8203;::Y \{\} �\}

Can be closed now, unless tests are somehow needed.

Yes, should be tested; can be done hopefully with typed exception test. Tagging testneeded.

@p6rt
Copy link
Author

p6rt commented Jun 16, 2014

From @peschwa

Am Mo 02. Jun 2014, 15​:47​:23, jnthn@​jnthn.net schrieb​:

On Thu Mar 13 19​:14​:31 2014, lue wrote​:

As of latest Rakudo​:

$ perl6 -e 'for 1,2,3, { say $_ }'
===SORRY!===
Expression needs parens to avoid taking the block
at -e​:1
------> for 1,2,3, { say $_ }�<EOL>
Missing block (apparently taken by expression)
at -e​:1
------> for 1,2,3, { say $_ }�<EOL>

$ perl6 -e 'CATCH { when X​::Y {} }'
===SORRY!===
Function 'X​::Y' needs parens to avoid taking the block
at -e​:1
------> CATCH { when X​::Y {}â�� }
Missing block (apparently taken by 'X​::Y')
at -e​:1
------> CATCH { when X​::Y {} â��}

Can be closed now, unless tests are somehow needed.

Yes, should be tested; can be done hopefully with typed exception
test. Tagging testneeded.

Added a typed exception in rakduo PR #​260, added tests for the two cases mentioned in this ticket in roast commit d6b8fac.

@p6rt p6rt closed this as completed Jul 18, 2014
@p6rt
Copy link
Author

p6rt commented Jul 18, 2014

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

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