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

LTA error message when there's syntax error for scope declarator in the scope of class declaration. #2249

Closed
p6rt opened this issue Nov 10, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Nov 10, 2010

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

Searchable as RT79002$

@p6rt
Copy link
Author

p6rt commented Nov 10, 2010

From @qiuhw

$ cat A.pm
class A;

has $.a syntax error;
$ perl6 A.pm
===SORRY!===
Confused at line 1, near "class A;\n\n"

So, why line 1. Isn't the syntax error introduced on line 3?

$ cat A.pm
class A {
  has $.a syntax error;
}
$ perl6 A.pm
===SORRY!===
Unable to parse blockoid, couldn't find final '}' at line 2

We definitely have a '}' at line 3.

And finally,
$ perl6 --version

This is Rakudo Perl 6, version 2010.10-12-g2c66f9a built on parrot 2.9.1
r49794

Copyright 2008-2010, The Perl Foundation

@p6rt
Copy link
Author

p6rt commented Nov 10, 2010

From @masak

On Wed Nov 10 00​:48​:43 2010, qiuhw wrote​:

[...]

$ cat A.pm
class A {
has $.a syntax error;
}
$ perl6 A.pm
===SORRY!===
Unable to parse blockoid, couldn't find final '}' at line 2

We definitely have a '}' at line 3.

Right, but the syntax error is at line 2, so that's where it can't find the '}'.

I agree that the syntax error is a bit off, though. It would probably be better if it just said
"syntax error" instead of "couldn't find final '}'".

@p6rt
Copy link
Author

p6rt commented Nov 10, 2010

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

@p6rt
Copy link
Author

p6rt commented Mar 8, 2013

From @jnthn

On Wed Nov 10 00​:48​:43 2010, qiuhw wrote​:

$ cat A.pm
class A;

has $.a syntax error;
$ perl6 A.pm
===SORRY!===
Confused at line 1, near "class A;\n\n"

So, why line 1. Isn't the syntax error introduced on line 3?

Now it tells you exactly where it is (with color, but can't bring that
in the ticket)​:

===SORRY!===
Two terms in a row
at A.pm​:3
------> has $.a <HERE>syntax error;

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Jan 25, 2014

From @peschwa

Am Fr 08. Mär 2013, 04​:50​:27, jnthn@​jnthn.net schrieb​:

On Wed Nov 10 00​:48​:43 2010, qiuhw wrote​:

$ cat A.pm
class A;

has $.a syntax error;
$ perl6 A.pm
===SORRY!===
Confused at line 1, near "class A;\n\n"

So, why line 1. Isn't the syntax error introduced on line 3?

Now it tells you exactly where it is (with color, but can't bring that
in the ticket)​:

===SORRY!===
Two terms in a row
at A.pm​:3
------> has $.a <HERE>syntax error;

Tagging testneeded.

/jnthn

Added a test to roast in commit b2af5d7, as per the example above.

@p6rt p6rt closed this as completed Jan 26, 2014
@p6rt
Copy link
Author

p6rt commented Jan 26, 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