
On Nov 14, 2019, at 11:21, Random832 <random832@fastmail.com> wrote:
On Thu, Nov 14, 2019, at 13:12, Andrew Barnert wrote: And then you can run it on a whole mess of code and verify that it’s only different in the cases where you want it to be different (what used to be an ERRORTOKEN or NEWLINE is now an NL because we’re in the middle of a with compound statement header).
Maybe any compound statement header? e.g. if/while with lots of and/or conditions, but more to the point it doesn't really make sense to make the rule work differently for different types of statements.
Sure. People don’t bring that up as much because with it and while you can already just use parens, but no reason they should be different. And that raises a point: the if keyword can appear in other places besides the start of a compound statement. Does tokenize.py have enough info to handle that properly? I don’t know, and the answer to that might be a good proxy to the question of whether it can be done in the real compiler without making parsing complicated, even if it won’t prove the answer either way.