-
Notifications
You must be signed in to change notification settings - Fork 0
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
Specialized error messages pegen does not support yet #122
Comments
Here are some examples from mypy test cases where we no longer output specialised error messages:
|
Yes, that is also an issue with the current |
Forgot this above, a fairly minor one since you need to parse with
throws |
Oh dear, I tried that, and ast.parse() produces a syntax error that has the entire rest of the file as the text attribute. This gets formatted really weirdly. I just was looking at this code for python#20072, but the problem here is in the ast module and how it interfaces to pegen, not in the formatting of exceptions. UPDATE: It seems to be happening whenever |
All the specialised error messages listed here are now supported by the new parser. See among others: python#20076, python#19865, python#20151, python#20153 and python#19911. |
Maybe there's an unmerged PR I haven't seen, but it looks like the following doesn't have a specialised error message on CPython master: |
That should be handled by python#20106 |
Here is a probably incomplete list of specialized error messages that are not yet supported by pegen and whose tests have been skipped.
f(x()=2)
throwsSyntaxError: expression cannot contain assignment, perhaps you meant "=="?
del f()
throwsSyntaxError: cannot delete function call
(a, "b", c) = (1, 2, 3)
throwsSyntaxError: cannot assign to literal
. This also included cases, where the invalid target is not the first one is a multiple-assignment statement, i.e.a = True = b
.f(L, x for x in L)
, which throwsSyntaxError: Generator expression must be parenthesized
.def f(*): pass
throwsSyntaxError: named arguments must follow bare *
The text was updated successfully, but these errors were encountered: