This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author georg.brandl
Recipients docs@python, georg.brandl, xxm
Date 2020-11-07.11:34:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604748881.78.0.776511324607.issue42284@roundup.psfhosted.org>
In-reply-to
Content
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).
History
Date User Action Args
2020-11-07 11:34:41georg.brandlsetrecipients: + georg.brandl, docs@python, xxm
2020-11-07 11:34:41georg.brandlsetmessageid: <1604748881.78.0.776511324607.issue42284@roundup.psfhosted.org>
2020-11-07 11:34:41georg.brandllinkissue42284 messages
2020-11-07 11:34:41georg.brandlcreate