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

backslash at end of file could print better error than "Confused" #3692

Closed
p6rt opened this issue Feb 20, 2015 · 7 comments
Closed

backslash at end of file could print better error than "Confused" #3692

p6rt opened this issue Feb 20, 2015 · 7 comments
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded

Comments

@p6rt
Copy link

p6rt commented Feb 20, 2015

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

Searchable as RT123887$

@p6rt
Copy link
Author

p6rt commented Feb 20, 2015

From @Tux

Why is the ; required at EOF?

$ perl -lE'say $/'

$ perl -lE'say $\'

$ perl6 -e 'say $/'
Nil
$ perl6 -e 'say $\'
===SORRY!=== Error while compiling -e
Missing semicolon.
at -e​:1
------> say $\⏏<EOL>
$ perl6 -e 'say $\;'
===SORRY!=== Error while compiling -e
Unsupported use of $\ variable; in Perl 6 please use the filehandle's .nl attribute
at -e​:1
------> say $\⏏;

--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using perl5.00307 .. 5.21 porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/

@p6rt
Copy link
Author

p6rt commented May 21, 2016

From @smls

Why is the ; required at EOF?

It isn't, the parser just got confused because $\ is not valid syntax.

In fact that's what the error message says now​:

  ➜ perl6 -e 'say $\'
  ===SORRY!=== Error while compiling -e
  Confused
  at -e​:1
  ------> say $\⏏<EOL>
  expecting any of​:
  postfix

Ticket can be closed once a test is added.

@p6rt
Copy link
Author

p6rt commented May 21, 2016

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

@p6rt
Copy link
Author

p6rt commented May 21, 2016

From @AlexDaniel

On Sat May 21 08​:48​:35 2016, smls75@​gmail.com wrote​:

Why is the ; required at EOF?

It isn't, the parser just got confused because $\ is not valid syntax.

In fact that's what the error message says now​:

➜  perl6 \-e 'say $\\'
===SORRY\!=== Error while compiling \-e
Confused
at \-e&#8203;:1
\-\-\-\-\-\-> say $\\⏏\<EOL>
    expecting any of&#8203;:
        postfix

Ticket can be closed once a test is added.

Perhaps we should promote it to LTA error message?

“Confused” is definitely not very helpful, that's why we have this bug report. A better error message could go like “Confused after encountering unspace” or something.

@p6rt
Copy link
Author

p6rt commented May 21, 2016

From @smls

"Confused" together with an arrow pointing to the exact location, is reasonably helpful IMO.

At the time the issue was reported, it said "Missing semicolon" which was a weird message to print, and that has been fixed.

But you're right, it could be better. "After encountering unspace" may not be quite accurate though...

@p6rt
Copy link
Author

p6rt commented Jul 5, 2016

From @zoffixznet

Tests added​: Raku/roast@4710138e25

@p6rt p6rt closed this as completed Jul 5, 2016
@p6rt
Copy link
Author

p6rt commented Jul 5, 2016

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

@p6rt p6rt added LTA Less Than Awesome; typically an error message that could be better testneeded labels 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 testneeded
Projects
None yet
Development

No branches or pull requests

1 participant