The Wayback Machine - https://web.archive.org/web/20211015220701/https://github.com/RustPython/RustPython/issues/2581
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

Syntax error messages are different from CPython's #2581

Open
coolreader18 opened this issue Apr 21, 2021 · 5 comments
Open

Syntax error messages are different from CPython's #2581

coolreader18 opened this issue Apr 21, 2021 · 5 comments

Comments

@coolreader18
Copy link
Member

@coolreader18 coolreader18 commented Apr 21, 2021

See e.g. #2570. Some of the unit tests there with "wrong error message" should be somewhat easy to fix - just correct the error message we have to match CPython's. Others might be trickier, since you'll need to add diagnostics to recognize bad syntax and give a more detailed error than "unexpected token". Also, I think around half of them could be fixed just by adding "invalid syntax" in the message for an unexpected token, since they're just checking for "invalid syntax" anywhere in the message (it's just what CPython uses to mean an unexpected token, I think).

@fanninpm
Copy link
Contributor

@fanninpm fanninpm commented May 12, 2021

This will also change when we decide to start emulating CPython 3.10, as that version will feature more helpful error messages.

@hk1997
Copy link

@hk1997 hk1997 commented Sep 9, 2021

Hi, is someone picking up this issue?
I can pick it up in such a case. Is there a list of what messages are different?

@mardab
Copy link

@mardab mardab commented Sep 23, 2021

Yes, a list of what's left to be changed would be priceless.

@fanninpm
Copy link
Contributor

@fanninpm fanninpm commented Sep 23, 2021

@chrismoradi
Copy link
Contributor

@chrismoradi chrismoradi commented Oct 5, 2021

PR #3206 fixed the "invalid syntax" ones. I tried working on the others, but don't know rust so these might be beyond my abilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants