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

Error message for unclosed curly quote points to the last line of the file #5858

Closed
p6rt opened this issue Dec 4, 2016 · 5 comments
Closed
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded

Comments

@p6rt
Copy link

p6rt commented Dec 4, 2016

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

Searchable as RT130261$

@p6rt
Copy link
Author

p6rt commented Dec 4, 2016

From @AlexDaniel

Code​:
say ‘hello';
say 42;
say 50;

Result​:
===SORRY!=== Error while compiling -e
Unable to parse expression in smart single quotes; couldn't find final "’"
at -e​:3
------> say 50;⏏<EOL>
  expecting any of​:
  argument list
  smart single quotes
  term

While the error message is right, it would be better if it also printed some information on where the initial curly quote is. As an example, see what happens if you try to do the same thing with a multiline comment (RT #​125247)​:

Code​:
say #`‘hello';
say 42;
say 50;

Result​:
===SORRY!=== Error while compiling -e
Couldn't find terminator ’ (corresponding ‘ was at line 1)
at -e​:3
------> say 50;⏏<EOL>
  expecting any of​:
  ’

@p6rt
Copy link
Author

p6rt commented Jan 8, 2018

From @AlexDaniel

Ah. This was fixed. Here's the pull request​: rakudo/rakudo#1183
And here's the right commit​: rakudo/rakudo@6542bb8

There should be tests for this already, I think.

On 2016-12-04 10​:22​:37, alex.jakimenko@​gmail.com wrote​:

Code​:
say ‘hello';
say 42;
say 50;

Result​:
== =SORRY!=== Error while compiling -e
Unable to parse expression in smart single quotes; couldn't find final
"’"
at -e​:3
------> say 50;⏏<EOL>
expecting any of​:
argument list
smart single quotes
term

While the error message is right, it would be better if it also
printed some information on where the initial curly quote is. As an
example, see what happens if you try to do the same thing with a
multiline comment (RT #​125247)​:

Code​:
say #`‘hello';
say 42;
say 50;

Result​:
== =SORRY!=== Error while compiling -e
Couldn't find terminator ’ (corresponding ‘ was at line 1)
at -e​:3
------> say 50;⏏<EOL>
expecting any of​:

@p6rt
Copy link
Author

p6rt commented Jan 8, 2018

From @AlexDaniel

Note that the error message is still LTA (says “corresponding starter” instead of mentioning “’”), for further progress see RT# 125641.

On 2018-01-08 15​:16​:47, alex.jakimenko@​gmail.com wrote​:

Ah. This was fixed. Here's the pull request​:
rakudo/rakudo#1183
And here's the right commit​:
rakudo/rakudo@6542bb8

There should be tests for this already, I think.

On 2016-12-04 10​:22​:37, alex.jakimenko@​gmail.com wrote​:

Code​:
say ‘hello';
say 42;
say 50;

Result​:
== =SORRY!=== Error while compiling -e
Unable to parse expression in smart single quotes; couldn't find
final
"’"
at -e​:3
------> say 50;⏏<EOL>
expecting any of​:
argument list
smart single quotes
term

While the error message is right, it would be better if it also
printed some information on where the initial curly quote is. As an
example, see what happens if you try to do the same thing with a
multiline comment (RT #​125247)​:

Code​:
say #`‘hello';
say 42;
say 50;

Result​:
== =SORRY!=== Error while compiling -e
Couldn't find terminator ’ (corresponding ‘ was at line 1)
at -e​:3
------> say 50;⏏<EOL>
expecting any of​:

@p6rt
Copy link
Author

p6rt commented Feb 3, 2018

From @AlexDaniel

Tests in Raku/roast@ceabda6

On 2018-01-08 15​:18​:46, alex.jakimenko@​gmail.com wrote​:

Note that the error message is still LTA (says “corresponding starter”
instead
of mentioning “’”), for further progress see RT#​125641.

On 2018-01-08 15​:16​:47, alex.jakimenko@​gmail.com wrote​:

Ah. This was fixed. Here's the pull request​:
rakudo/rakudo#1183
And here's the right commit​:

rakudo/rakudo@6542bb8

There should be tests for this already, I think.

On 2016-12-04 10​:22​:37, alex.jakimenko@​gmail.com wrote​:

Code​:
say ‘hello';
say 42;
say 50;

Result​:
== =SORRY!=== Error while compiling -e
Unable to parse expression in smart single quotes; couldn't find
final
"’"
at -e​:3
------> say 50;⏏<EOL>
expecting any of​:
argument list
smart single quotes
term

While the error message is right, it would be better if it also
printed some information on where the initial curly quote is. As an
example, see what happens if you try to do the same thing with a
multiline comment (RT #​125247)​:

Code​:
say #`‘hello';
say 42;
say 50;

Result​:
== =SORRY!=== Error while compiling -e
Couldn't find terminator ’ (corresponding ‘ was at line 1)
at -e​:3
------> say 50;⏏<EOL>
expecting any of​:

@p6rt
Copy link
Author

p6rt commented Feb 3, 2018

@AlexDaniel - Status changed from 'new' to 'resolved'

@p6rt p6rt closed this as completed Feb 3, 2018
@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