rest25/reference/toplevel_components.rst => rest262/reference/toplevel_components.rst
61.. _file-input:
62
63File input
64==========
65
66All input read from non-interactive files has the same form:
67
68.. productionlist::
n69-   file_input: (NEWLINE \| `statement`)\*
n69+   file_input: (NEWLINE | `statement`)*
70
71This syntax is used in the following situations:
72
73* when parsing a complete Python program (from a file or from a string);
74
75* when parsing a module;
76
77* when parsing a string passed to the :keyword:`exec` statement;
80.. _interactive:
81
82Interactive input
83=================
84
85Input in interactive mode is parsed using the following grammar:
86
87.. productionlist::
n88-   interactive_input: [`stmt_list`] NEWLINE \| `compound_stmt` NEWLINE
n88+   interactive_input: [`stmt_list`] NEWLINE | `compound_stmt` NEWLINE
89
90Note that a (top-level) compound statement must be followed by a blank line in
91interactive mode; this is needed to help the parser detect the end of the input.
92
93
94.. _expression-input:
95
96Expression input
99.. index:: single: input
100
101.. index:: builtin: eval
102
103There are two forms of expression input.  Both ignore leading whitespace. The
104string argument to :func:`eval` must have the following form:
105
106.. productionlist::
t107-   eval_input: `expression_list` NEWLINE\*
t107+   eval_input: `expression_list` NEWLINE*
108
109.. index:: builtin: input
110
111The input line read by :func:`input` must have the following form:
112
113.. productionlist::
114   input_input: `expression_list` NEWLINE
115
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op