Message380504
This grammar specification doesn't contain a full specification of code that won't raise SyntaxError. There are several conditions that aren't checked by the generated parser, but at a later stage in the compilation process.
While probably possible to express in general, this would make the grammar much more complex. For this example, it would require different definitions of `suite`, `stmt`, `simple_stmt`, `compound_stmt` and so on, to track where control-flow statements are allowed. Other definitions need to track `nonlocal` and you'd get a combinatorial explosion of productions.
You could propose a PR to add a note somewhere on that page (but on the master branch, not 3.6 which is unmaintained). |
|
Date |
User |
Action |
Args |
2020-11-07 11:34:41 | georg.brandl | set | recipients:
+ georg.brandl, docs@python, xxm |
2020-11-07 11:34:41 | georg.brandl | set | messageid: <1604748881.78.0.776511324607.issue42284@roundup.psfhosted.org> |
2020-11-07 11:34:41 | georg.brandl | link | issue42284 messages |
2020-11-07 11:34:41 | georg.brandl | create | |
|