Arjun <ccldar...@icloud.com> added the comment:

> This one will be very tricky to do correctly because the '=' is very 
> context-sensitive and the parser can be confused when backtracking, so this 
> *may* be quite delicate/complex

Well, I was thinking we could just do a simple check in 
_PyPegen_check_tokenizer_errors or _PyPegen_run_parser functions. If the last 
three tokens in the Parser object's tokens array are NAME, EQUAL/MINEQUAL/etc 
and NEWLINE, we raise the special error. Is this the right way to do it? I saw 
that unclosed parentheses' special error are checked in the same place. 

> I suspect this is going to be a pain for malformed expressions on the right

Yea, I realized that the "expected an expression" error can be used in multiple 
places. Could be added one by one?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44324>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to