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

Newline Before Commas Results in 'Bogus Statement' Error #4952

Closed
p6rt opened this issue Dec 30, 2015 · 5 comments
Closed

Newline Before Commas Results in 'Bogus Statement' Error #4952

p6rt opened this issue Dec 30, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Dec 30, 2015

Migrated from rt.perl.org#127091 (status was 'rejected')

Searchable as RT127091$

@p6rt
Copy link
Author

p6rt commented Dec 30, 2015

From @zoffixznet

In the output below, you can see that inserting a new line before the comma results in an error.

Mentioned it here too​: http://irclog.perlgeek.de/perl6/2015-12-30#i_11804178

<ZoffixW> m​: my @​c = ( [{foo => 'bar'},],);
<camelia> rakudo-moar d08e04​: ( no output )
<ZoffixW> m​: my @​c = ( [{foo => 'bar'} ,],);
<camelia> rakudo-moar d08e04​: ( no output )
<ZoffixW> m​: my @​c = ( [{foo => 'bar'}␤,],);
<camelia> rakudo-moar d08e04​: OUTPUT«===SORRY!=== Error while compiling /tmp/4i3gP6j3p1␤Bogus statement␤at /tmp/4i3gP6j3p1​:2␤------> my @​c = ( [{foo => 'bar'}⏏<EOL>␤ expecting any of​:␤ prefix␤ statement end␤ term␤»
<ZoffixW> m​: my @​c = ( [{foo => 'bar'} ␤ ,],);
<camelia> rakudo-moar d08e04​: OUTPUT«===SORRY!=== Error while compiling /tmp/ClpK2AcBTF␤Bogus statement␤at /tmp/ClpK2AcBTF​:2␤------> my @​c = ( [{foo => 'bar'}⏏ ␤ expecting any of​:␤ prefix␤ statement end␤ term␤»

@p6rt
Copy link
Author

p6rt commented Dec 30, 2015

From @zoffixznet

Rejecting as per​: "<lucasb> ZoffixW​: newline after "}" ends the statement"

@p6rt
Copy link
Author

p6rt commented Dec 30, 2015

@zoffixznet - Status changed from 'new' to 'rejected'

@p6rt p6rt closed this as completed Dec 30, 2015
@p6rt
Copy link
Author

p6rt commented Dec 30, 2015

From @timo

Isn't this just about "a line ending in } gets a ; for free"?

@p6rt
Copy link
Author

p6rt commented Dec 31, 2015

From @lizmat

On 30 Dec 2015, at 17​:32, Zoffix Znet (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Zoffix Znet
# Please include the string​: [perl #​127091]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=127091 >

In the output below, you can see that inserting a new line before the comma results in an error.

Mentioned it here too​: http://irclog.perlgeek.de/perl6/2015-12-30#i_11804178

<ZoffixW> m​: my @​c = ( [{foo => 'bar'},],);
<camelia> rakudo-moar d08e04​: ( no output )
<ZoffixW> m​: my @​c = ( [{foo => 'bar'} ,],);
<camelia> rakudo-moar d08e04​: ( no output )
<ZoffixW> m​: my @​c = ( [{foo => 'bar'}␤,],);
<camelia> rakudo-moar d08e04​: OUTPUT«===SORRY!=== Error while compiling /tmp/4i3gP6j3p1␤Bogus statement␤at /tmp/4i3gP6j3p1​:2␤------> my @​c = ( [{foo => 'bar'}⏏<EOL>␤ expecting any of​:␤ prefix␤ statement end␤ term␤»
<ZoffixW> m​: my @​c = ( [{foo => 'bar'} ␤ ,],);
<camelia> rakudo-moar d08e04​: OUTPUT«===SORRY!=== Error while compiling /tmp/ClpK2AcBTF␤Bogus statement␤at /tmp/ClpK2AcBTF​:2␤------> my @​c = ( [{foo => 'bar'}⏏ ␤ expecting any of​:␤ prefix␤ statement end␤ term␤»

I concur with timotimo, this is ENOTABUG, but a WAT!

A closing brace at the end of a line (with or without whitespace) is equivalent to a ; *ALWAYS*. And thus the statement becomes bogus.

Can be closed afaiac .

Liz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant