On Mon, Jul 8, 2019 at 1:51 PM Brett Cannon <br...@python.org> wrote:

> Hopefully Pablo's proposed solution works.


I'm sure it will.


> If it doesn't, could this one optimization be left in the peephole
> optimizer at bytecode level? Otherwise is another solution to follow
> through with
> https://discuss.python.org/t/switch-pythons-parsing-tech-to-something-more-powerful-than-ll-1/379
> and switch the parser so it can handle all syntax errors on its own without
> support from the AST analyzer?
>

Thinking about this, that's possible, but it would require bloating the
grammar with variants that allow continue/break or not, allow return/yield
or not, allow await or not. So I think this particular thing is still best
handled by a separate check. (The PEG-based parser I am contemplating would
be able to tell an expression statement from an assignment statement
without a separate pass to make sure you don't try to assign to a call, and
it would allow a much more elegant approach to keyword arguments and the
walrus operator.)

--Guido van Rossum (python.org/~guido)
*Pronouns: he/him/his **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/QQTQKVK73CETNX73FZDFVUBB7TQ6L6KD/

Reply via email to