This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients gvanrossum, lys.nikolaou, pablogsal
Date 2020-05-11.23:04:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589238278.35.0.286610326928.issue40599@roundup.psfhosted.org>
In-reply-to
Content
> SyntaxError: Invalid syntax. Expected one of: for, pass, lambda, False, global, True, __new_parser__, if, raise, continue, not, break, while, None, del, nonlocal, import, assert, return, class, with, def, try, from, yield

Haha, that is a good point. It also reveals the easter egg :)

> The beauty of Python's detail-free syntax error is that it doesn't tell you what it expects -- because parsers are dumb, what the parser expected is rarely what's wrong with your code -- and it requires the user to understand how the parser works to interpret the error message.

Right, I think will be very difficult to actually give you something very close to what the actual problem is.

I started this draft based on some similar errors that I have seen in other parsers but is true that with the exception of rust, all other grammars I explored and played with were mucn simpler, so the errors were not super verbose.

I think i will close the issue and the PR unless you think there is something worth exploring/discussing left, as it does not look that we can get something less verbose in an easy way.
History
Date User Action Args
2020-05-11 23:04:38pablogsalsetrecipients: + pablogsal, gvanrossum, lys.nikolaou
2020-05-11 23:04:38pablogsalsetmessageid: <1589238278.35.0.286610326928.issue40599@roundup.psfhosted.org>
2020-05-11 23:04:38pablogsallinkissue40599 messages
2020-05-11 23:04:38pablogsalcreate