Terry J. Reedy added the comment:
The grammar presented in the doc is intentionally slightly simplified from the
one actually used by the LL(1) parser. The parser has to know what type of
statement it is parsing after the first token or so, so it needs a separate
production (concept) for
Jayanth Koushik added the comment:
Oh ok. That makes sense.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22243
___
___
Python-bugs-list
Roundup Robot added the comment:
New changeset 5496bf8972b6 by Terry Jan Reedy in branch '2.7':
Issue #22243: fix except grammar in reference.
http://hg.python.org/cpython/rev/5496bf8972b6
New changeset a249f1f879be by Terry Jan Reedy in branch '3.4':
Issue #22243: fix except grammar in
Changes by Terry J. Reedy tjre...@udel.edu:
--
resolution: - fixed
stage: - resolved
status: open - closed
type: enhancement - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22243
Changes by Benjamin Peterson benja...@python.org:
--
keywords: +easy
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22243
___
Jayanth Koushik added the comment:
The whole page on compound statements seems to be rife with inconsistencies.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22243
___
Terry J. Reedy added the comment:
I think 'target' can just be replaced by 'identifier'.
Using 'expression' (or 'expr' in the ast doc) for what should be 'exceptions:
identifier' or paranthesized tuple of identifiers;, is also too broad. However,
that must be enforced in the compiler rather
Michael Williamson added the comment:
Using 'expression' (or 'expr' in the ast doc) for what should be 'exceptions:
identifier' or paranthesized tuple of identifiers;, is also too broad.
However, that must be enforced in the compiler rather than the parser, and
compiler restrictions are
Terry J. Reedy added the comment:
You are right, only the result, and not the form of 'expression' is
constrained. I will let Jayanth propose other errors.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22243
Jayanth Koushik added the comment:
The page on compound statements defines compound statements as:
compound_stmt ::= if_stmt
| while_stmt
| for_stmt
| try_stmt
| with_stmt
| funcdef
New submission from Michael Williamson:
In the docs for the try statement [1], part of the grammar is:
try1_stmt ::= try : suite
(except [expression [as target]] : suite)+
[else : suite]
[finally : suite]
The `target` rule allows any assignable
Jayanth Koushik added the comment:
Yes. Seems to be a documentation error. The full grammar specification [1] uses
'NAME' instead of 'target'.
[1]: https://docs.python.org/3/reference/grammar.html
--
nosy: +jayanthkoushik
type: - enhancement
___
12 matches
Mail list logo