Pablo Galindo Salgado <[email protected]> added the comment:
> We managed to do this for 'with' so it should be possible here too, I'd
> think. The "committing" token would be the newline following the close
> parenthesis.
I am not so sure is that inmediate. Changing the assert statement from:
'assert' a=expression b=[',' z=expression { z }]
to
| 'assert' '(' a=expression b=[',' z=expression { z }] ')'
| 'assert' a=expression b=[',' z=expression { z }]
will render this invalid:
assert (a, b) <= c, "something"
The reason is that it will parse the (a, b) as the assert statement eagerly and
then it will fail to parse the rest.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue46167>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com