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

Mention context when suspecting runaway quotes (say "foo'; my $x = 42;) #6551

Open
p6rt opened this issue Sep 26, 2017 · 4 comments
Open

Mention context when suspecting runaway quotes (say "foo'; my $x = 42;) #6551

p6rt opened this issue Sep 26, 2017 · 4 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Sep 26, 2017

Migrated from rt.perl.org#132168 (status was 'new')

Searchable as RT132168$

@p6rt
Copy link
Author

p6rt commented Nov 9, 2015

From @jonathanstowe

perl6 -e 'my $a = "jsjsjs {"; for <a b> -> $b { say $b }'
===SORRY!=== Error while compiling -e
Variable '$b' is not declared
at -e​:1
------> my $a = "jsjsjs {"; for <a b> -> ⏏$b { say $b }

Obviously it is fine if the '{' is backslashed.

Similarly​:

<ilmari> m​: my $a = "{ 42"; for <a b> -> $b { say $b } # also LTA error
<camelia> rakudo-moar 65bfb6​: OUTPUT«===SORRY!=== Error while compiling /tmp/m116oiicso␤Two terms in a row␤at /tmp/m116oiicso​:1␤------> my $a = "{ 42⏏"; for <a b> -> $b { say $b } # also LTA␤ expecting any of​:␤ infix␤ infix stopper␤ stateme…»

This is perl6 version 2015.10-169-gfd3927d built on MoarVM version 2015.10-51-ga362d21

@p6rt
Copy link
Author

p6rt commented Sep 26, 2017

From @AlexDaniel

Code​:
say "foo';
my $x = 42;

Result​:
===SORRY!=== Error while compiling -e
Variable '$x' is not declared
at -e​:2
------> my ⏏$x = 42;

The error message is of course very confusing. I think that any “not declared” error message that happen within interpolating quotes should say something like​:

Variable '$x' is not declared (in double quotes started at line 1)

I think this would give enough clues to figure out the actual problem.

Related, but different ticket​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=130261
See also this discussion on perl6.users​: https://www.nntp.perl.org/group/perl.perl6.users/2017/09/msg4348.html

@p6rt
Copy link
Author

p6rt commented Oct 3, 2017

From @AlexDaniel

Oh. That's actually related to this ticket​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=132168

I'll merge it because both tickets are asking for the same problem to be resolved.

On 2015-11-09 05​:03​:59, jns+bc@​gellyfish.co.uk wrote​:

perl6 -e 'my $a = "jsjsjs {"; for <a b> -> $b { say $b }'
===SORRY!=== Error while compiling -e
Variable '$b' is not declared
at -e​:1
------> my $a = "jsjsjs {"; for <a b> -> ⏏$b { say $b }

Obviously it is fine if the '{' is backslashed.

Similarly​:

<ilmari> m​: my $a = "{ 42"; for <a b> -> $b { say $b } # also LTA
error
<camelia> rakudo-moar 65bfb6​: OUTPUT«===SORRY!=== Error while
compiling /tmp/m116oiicso␤Two terms in a row␤at
/tmp/m116oiicso​:1␤------> my $a = "{ 42⏏"; for <a b> -> $b { say $b }
# also LTA␤ expecting any of​:␤ infix␤ infix stopper␤
stateme…»

This is perl6 version 2015.10-169-gfd3927d built on MoarVM version
2015.10-51-ga362d21

@p6rt
Copy link
Author

p6rt commented Oct 3, 2017

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

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better
Projects
None yet
Development

No branches or pull requests

1 participant