Kaydet (Commit) c411fa68 authored tarafından Fred Drake's avatar Fred Drake

Revised description of blank line handling for the interpreter, based

on a comment from /F.
üst fab41f17
...@@ -89,6 +89,7 @@ for string literals (i.e., tokens other than string literals cannot be ...@@ -89,6 +89,7 @@ for string literals (i.e., tokens other than string literals cannot be
split across physical lines using a backslash). A backslash is split across physical lines using a backslash). A backslash is
illegal elsewhere on a line outside a string literal. illegal elsewhere on a line outside a string literal.
\subsection{Implicit line joining\label{implicit-joining}} \subsection{Implicit line joining\label{implicit-joining}}
Expressions in parentheses, square brackets or curly braces can be Expressions in parentheses, square brackets or curly braces can be
...@@ -108,14 +109,17 @@ allowed. There is no NEWLINE token between implicit continuation ...@@ -108,14 +109,17 @@ allowed. There is no NEWLINE token between implicit continuation
lines. Implicitly continued lines can also occur within triple-quoted lines. Implicitly continued lines can also occur within triple-quoted
strings (see below); in that case they cannot carry comments. strings (see below); in that case they cannot carry comments.
\subsection{Blank lines\label{blank-lines}}
A logical line that contains only spaces, tabs, formfeeds and possibly a \subsection{Blank lines \index{blank line}\label{blank-lines}}
comment, is ignored (i.e., no NEWLINE token is generated), except that
during interactive input of statements, an entirely blank logical line A logical line that contains only spaces, tabs, formfeeds and possibly
(i.e. one containing not even whitespace or a comment) a comment, is ignored (i.e., no NEWLINE token is generated). During
terminates a multi-line statement. interactive input of statements, handling of a blank line may differ
\index{blank line} depending on the implementation of the read-eval-print loop. In the
standard implementation, an entirely blank logical line (i.e.\ one
containing not even whitespace or a comment) terminates a multi-line
statement.
\subsection{Indentation\label{indentation}} \subsection{Indentation\label{indentation}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment