mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-130587: Add hand-written docs for non-OP tokens (GH-130588)
Co-authored-by: Blaise Pabon <blaise@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
This commit is contained in:
parent
b8367e7cf3
commit
4bced29a74
4 changed files with 293 additions and 258 deletions
|
@ -69,7 +69,7 @@ All input read from non-interactive files has the same form:
|
|||
.. grammar-snippet::
|
||||
:group: python-grammar
|
||||
|
||||
file_input: (NEWLINE | `statement`)*
|
||||
file_input: (NEWLINE | `statement`)* ENDMARKER
|
||||
|
||||
This syntax is used in the following situations:
|
||||
|
||||
|
@ -90,7 +90,7 @@ Input in interactive mode is parsed using the following grammar:
|
|||
.. grammar-snippet::
|
||||
:group: python-grammar
|
||||
|
||||
interactive_input: [`stmt_list`] NEWLINE | `compound_stmt` NEWLINE
|
||||
interactive_input: [`stmt_list`] NEWLINE | `compound_stmt` NEWLINE | ENDMARKER
|
||||
|
||||
Note that a (top-level) compound statement must be followed by a blank line in
|
||||
interactive mode; this is needed to help the parser detect the end of the input.
|
||||
|
@ -107,5 +107,7 @@ Expression input
|
|||
:func:`eval` is used for expression input. It ignores leading whitespace. The
|
||||
string argument to :func:`eval` must have the following form:
|
||||
|
||||
.. productionlist:: python-grammar
|
||||
eval_input: `expression_list` NEWLINE*
|
||||
.. grammar-snippet::
|
||||
:group: python-grammar
|
||||
|
||||
eval_input: `expression_list` NEWLINE* ENDMARKER
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue