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 messages when right bracket is missing: (), [], "" and so on #4413

Open
p6rt opened this issue Jul 18, 2015 · 5 comments
Open

error messages when right bracket is missing: (), [], "" and so on #4413

p6rt opened this issue Jul 18, 2015 · 5 comments
Labels
LTA Less Than Awesome; typically an error message that could be better testneeded

Comments

@p6rt
Copy link

p6rt commented Jul 18, 2015

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

Searchable as RT125641$

@p6rt
Copy link
Author

p6rt commented Jul 18, 2015

From @AlexDaniel

Similar issue​: https://rt.perl.org/Public/Bug/Display.html?id=125247
(unclosed multiline comments). This time it is about other unclosed things.

Code​:
say $<word;
# some code here

Error​:
Unable to parse quote-words subscript; couldn't find right angle quote
at ./test.pl​:25
------> <BOL>⏏<EOL>
  expecting any of​:
  argument list
  term

Similar problem with​:
say <word;
say <<word;
say (word;
say [word;
... more?

1) "expecting any of" section does not help that much. There is no need to
add terms or argument lists to the end of your file to fix the problem, the
only thing that is actually expected is a closing bracket.
2) The end of file does not count as a helpful line number, especially if
the file is long. It would be great to have the same "(corresponding < was
at line 1)"-like message as with multiline comments

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

From @AlexDaniel

See this pull request​: rakudo/rakudo#1183

Unfortunately not all of the things are covered. For example​:

perl6 -e 'my $x = q​:to/foo/;
blah
'
===SORRY!=== Error while compiling -e
Ending delimiter foo not found
at -e​:3
------> <BOL>⏏<EOL>
    expecting any of​:
        whitespace

Then there's also​:
* https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6
/Grammar.nqp#L3741
* https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L3780-L3792
* https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L3820-L3826

And maybe other things too. For example, nqp itself prints a similar error message and does not mention the starter. I don't know if any user will ever see the error message from NQP though.

So there's a lot to be done to resolve this ticket fully…

Oh, also! I did not remove “expecting any of​:” part. This has to be done also.

On 2015-07-18 12​:38​:41, alex.jakimenko@​gmail.com wrote​:

Similar issue​: https://rt.perl.org/Public/Bug/Display.html?id=125247
(unclosed multiline comments). This time it is about other unclosed things.

Code​:
say $<word;
# some code here

Error​:
Unable to parse quote-words subscript; couldn't find right angle quote
at ./test.pl​:25
------> <BOL>⏏<EOL>
expecting any of​:
argument list
term

Similar problem with​:
say <word;
say <<word;
say (word;
say [word;
... more?

1) "expecting any of" section does not help that much. There is no need to
add terms or argument lists to the end of your file to fix the problem, the
only thing that is actually expected is a closing bracket.
2) The end of file does not count as a helpful line number, especially if
the file is long. It would be great to have the same "(corresponding < was
at line 1)"-like message as with multiline comments

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

From @AlexDaniel

PR was merged, tests needed.

On 2017-10-06 19​:40​:44, alex.jakimenko@​gmail.com wrote​:

See this pull request​: rakudo/rakudo#1183

Unfortunately not all of the things are covered. For example​:

perl6 -e 'my $x = q​:to/foo/;
blah
'
===SORRY!=== Error while compiling -e
Ending delimiter foo not found
at -e​:3
------> <BOL>⏏<EOL>
expecting any of​:
whitespace

Then there's also​:
*
https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6
/Grammar.nqp#L3741
*
https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L3780-
L3792
*
https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L3820-
L3826

And maybe other things too. For example, nqp itself prints a similar
error
message and does not mention the starter. I don't know if any user
will ever
see the error message from NQP though.

So there's a lot to be done to resolve this ticket fully…

Oh, also! I did not remove “expecting any of​:” part. This has to be
done also.

On 2015-07-18 12​:38​:41, alex.jakimenko@​gmail.com wrote​:

Similar issue​: https://rt.perl.org/Public/Bug/Display.html?id=125247
(unclosed multiline comments). This time it is about other unclosed
things.

Code​:
say $<word;
# some code here

Error​:
Unable to parse quote-words subscript; couldn't find right angle
quote
at ./test.pl​:25
------> <BOL>⏏<EOL>
expecting any of​:
argument list
term

Similar problem with​:
say <word;
say <<word;
say (word;
say [word;
... more?

1) "expecting any of" section does not help that much. There is no
need to
add terms or argument lists to the end of your file to fix the
problem, the
only thing that is actually expected is a closing bracket.
2) The end of file does not count as a helpful line number,
especially if
the file is long. It would be great to have the same "(corresponding
< was
at line 1)"-like message as with multiline comments

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

From @AlexDaniel

Ah, sorry. Even though some tests are needed, this ticket is still not fully resolved. I'll try to split it right now.

On 2017-10-07 09​:40​:03, alex.jakimenko@​gmail.com wrote​:

PR was merged, tests needed.

On 2017-10-06 19​:40​:44, alex.jakimenko@​gmail.com wrote​:

See this pull request​: rakudo/rakudo#1183

Unfortunately not all of the things are covered. For example​:

perl6 -e 'my $x = q​:to/foo/;
blah
'
===SORRY!=== Error while compiling -e
Ending delimiter foo not found
at -e​:3
------> <BOL>⏏<EOL>
expecting any of​:
whitespace

Then there's also​:
*

https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6

/Grammar.nqp#L3741
*

https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L3780-

L3792
*

https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L3820-

L3826

And maybe other things too. For example, nqp itself prints a similar
error
message and does not mention the starter. I don't know if any user
will ever
see the error message from NQP though.

So there's a lot to be done to resolve this ticket fully…

Oh, also! I did not remove “expecting any of​:” part. This has to be
done also.

On 2015-07-18 12​:38​:41, alex.jakimenko@​gmail.com wrote​:

Similar issue​:
https://rt.perl.org/Public/Bug/Display.html?id=125247
(unclosed multiline comments). This time it is about other unclosed
things.

Code​:
say $<word;
# some code here

Error​:
Unable to parse quote-words subscript; couldn't find right angle
quote
at ./test.pl​:25
------> <BOL>⏏<EOL>
expecting any of​:
argument list
term

Similar problem with​:
say <word;
say <<word;
say (word;
say [word;
... more?

1) "expecting any of" section does not help that much. There is no
need to
add terms or argument lists to the end of your file to fix the
problem, the
only thing that is actually expected is a closing bracket.
2) The end of file does not count as a helpful line number,
especially if
the file is long. It would be great to have the same
"(corresponding
< was
at line 1)"-like message as with multiline comments

@p6rt
Copy link
Author

p6rt commented Oct 7, 2017

From @AlexDaniel

OK. There are 5 new tickets for all other issues. In this particular ticket let's talk about (), [], "", etc. Basically, anything that currently says “corresponding starter” (word “starter” instead of the actual starter). It should really print the actual starter, but for now it's a good way to figure out which error message you're seeing.

Try to cover as many things as you can in tests and we'll close this ticket.

See rakudo/rakudo@6542bb8 for some info.

On 2017-10-07 09​:41​:19, alex.jakimenko@​gmail.com wrote​:

Ah, sorry. Even though some tests are needed, this ticket is still not
fully
resolved. I'll try to split it right now.

On 2017-10-07 09​:40​:03, alex.jakimenko@​gmail.com wrote​:

PR was merged, tests needed.

On 2017-10-06 19​:40​:44, alex.jakimenko@​gmail.com wrote​:

See this pull request​: rakudo/rakudo#1183

Unfortunately not all of the things are covered. For example​:

perl6 -e 'my $x = q​:to/foo/;
blah
'
===SORRY!=== Error while compiling -e
Ending delimiter foo not found
at -e​:3
------> <BOL>⏏<EOL>
expecting any of​:
whitespace

Then there's also​:
*

https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6

/Grammar.nqp#L3741
*

https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L3780-

L3792
*

https://github.com/rakudo/rakudo/blob/f62ae60c48d1372df18b49aca44e10af44ead2d6/src/Perl6/Grammar.nqp#L3820-

L3826

And maybe other things too. For example, nqp itself prints a
similar
error
message and does not mention the starter. I don't know if any user
will ever
see the error message from NQP though.

So there's a lot to be done to resolve this ticket fully…

Oh, also! I did not remove “expecting any of​:” part. This has to be
done also.

On 2015-07-18 12​:38​:41, alex.jakimenko@​gmail.com wrote​:

Similar issue​:
https://rt.perl.org/Public/Bug/Display.html?id=125247
(unclosed multiline comments). This time it is about other
unclosed
things.

Code​:
say $<word;
# some code here

Error​:
Unable to parse quote-words subscript; couldn't find right angle
quote
at ./test.pl​:25
------> <BOL>⏏<EOL>
expecting any of​:
argument list
term

Similar problem with​:
say <word;
say <<word;
say (word;
say [word;
... more?

1) "expecting any of" section does not help that much. There is
no
need to
add terms or argument lists to the end of your file to fix the
problem, the
only thing that is actually expected is a closing bracket.
2) The end of file does not count as a helpful line number,
especially if
the file is long. It would be great to have the same
"(corresponding
< was
at line 1)"-like message as with multiline comments

@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