Commit f5eae668 authored by Fred Drake's avatar Fred Drake

Add "yeild" to the list of keywords.

Fix a very minor (but annoying when looking for things!) markup nit.
parent 1ab1f71e
...@@ -28,11 +28,13 @@ though the current implementation appears to favor Latin-1. This ...@@ -28,11 +28,13 @@ though the current implementation appears to favor Latin-1. This
applies both to the source character set and the run-time character applies both to the source character set and the run-time character
set. set.
\section{Line structure\label{line-structure}} \section{Line structure\label{line-structure}}
A Python program is divided into a number of \emph{logical lines}. A Python program is divided into a number of \emph{logical lines}.
\index{line structure} \index{line structure}
\subsection{Logical lines\label{logical}} \subsection{Logical lines\label{logical}}
The end of The end of
...@@ -46,6 +48,7 @@ by following the explicit or implicit \emph{line joining} rules. ...@@ -46,6 +48,7 @@ by following the explicit or implicit \emph{line joining} rules.
\index{line joining} \index{line joining}
\index{NEWLINE token} \index{NEWLINE token}
\subsection{Physical lines\label{physical}} \subsection{Physical lines\label{physical}}
A physical line ends in whatever the current platform's convention is A physical line ends in whatever the current platform's convention is
...@@ -54,6 +57,7 @@ character. On DOS/Windows, it is the \ASCII{} sequence CR LF (return ...@@ -54,6 +57,7 @@ character. On DOS/Windows, it is the \ASCII{} sequence CR LF (return
followed by linefeed). On Macintosh, it is the \ASCII{} CR (return) followed by linefeed). On Macintosh, it is the \ASCII{} CR (return)
character. character.
\subsection{Comments\label{comments}} \subsection{Comments\label{comments}}
A comment starts with a hash character (\code{\#}) that is not part of A comment starts with a hash character (\code{\#}) that is not part of
...@@ -64,6 +68,7 @@ Comments are ignored by the syntax; they are not tokens. ...@@ -64,6 +68,7 @@ Comments are ignored by the syntax; they are not tokens.
\index{comment} \index{comment}
\index{hash character} \index{hash character}
\subsection{Explicit line joining\label{explicit-joining}} \subsection{Explicit line joining\label{explicit-joining}}
Two or more physical lines may be joined into logical lines using Two or more physical lines may be joined into logical lines using
...@@ -203,6 +208,7 @@ The following example shows various indentation errors: ...@@ -203,6 +208,7 @@ The following example shows various indentation errors:
last error is found by the lexical analyzer --- the indentation of last error is found by the lexical analyzer --- the indentation of
\code{return r} does not match a level popped off the stack.) \code{return r} does not match a level popped off the stack.)
\subsection{Whitespace between tokens\label{whitespace}} \subsection{Whitespace between tokens\label{whitespace}}
Except at the beginning of a logical line or in string literals, the Except at the beginning of a logical line or in string literals, the
...@@ -211,6 +217,7 @@ interchangeably to separate tokens. Whitespace is needed between two ...@@ -211,6 +217,7 @@ interchangeably to separate tokens. Whitespace is needed between two
tokens only if their concatenation could otherwise be interpreted as a tokens only if their concatenation could otherwise be interpreted as a
different token (e.g., ab is one token, but a b is two tokens). different token (e.g., ab is one token, but a b is two tokens).
\section{Other tokens\label{other-tokens}} \section{Other tokens\label{other-tokens}}
Besides NEWLINE, INDENT and DEDENT, the following categories of tokens Besides NEWLINE, INDENT and DEDENT, the following categories of tokens
...@@ -222,6 +229,7 @@ Where ...@@ -222,6 +229,7 @@ Where
ambiguity exists, a token comprises the longest possible string that ambiguity exists, a token comprises the longest possible string that
forms a legal token, when read from left to right. forms a legal token, when read from left to right.
\section{Identifiers and keywords\label{identifiers}} \section{Identifiers and keywords\label{identifiers}}
Identifiers (also referred to as \emph{names}) are described by the following Identifiers (also referred to as \emph{names}) are described by the following
...@@ -239,6 +247,7 @@ digit: "0"..."9" ...@@ -239,6 +247,7 @@ digit: "0"..."9"
Identifiers are unlimited in length. Case is significant. Identifiers are unlimited in length. Case is significant.
\subsection{Keywords\label{keywords}} \subsection{Keywords\label{keywords}}
The following identifiers are used as reserved words, or The following identifiers are used as reserved words, or
...@@ -251,13 +260,14 @@ identifiers. They must be spelled exactly as written here:% ...@@ -251,13 +260,14 @@ identifiers. They must be spelled exactly as written here:%
and del for is raise and del for is raise
assert elif from lambda return assert elif from lambda return
break else global not try break else global not try
class except if or while class except if or yeild
continue exec import pass continue exec import pass while
def finally in print def finally in print
\end{verbatim} \end{verbatim}
% When adding keywords, use reswords.py for reformatting % When adding keywords, use reswords.py for reformatting
\subsection{Reserved classes of identifiers\label{id-classes}} \subsection{Reserved classes of identifiers\label{id-classes}}
Certain classes of identifiers (besides keywords) have special Certain classes of identifiers (besides keywords) have special
...@@ -287,6 +297,7 @@ Literals are notations for constant values of some built-in types. ...@@ -287,6 +297,7 @@ Literals are notations for constant values of some built-in types.
\index{literal} \index{literal}
\index{constant} \index{constant}
\subsection{String literals\label{strings}} \subsection{String literals\label{strings}}
String literals are described by the following lexical definitions: String literals are described by the following lexical definitions:
...@@ -384,6 +395,7 @@ escape the following quote character). Note also that a single ...@@ -384,6 +395,7 @@ escape the following quote character). Note also that a single
backslash followed by a newline is interpreted as those two characters backslash followed by a newline is interpreted as those two characters
as part of the string, \emph{not} as a line continuation. as part of the string, \emph{not} as a line continuation.
\subsection{String literal concatenation\label{string-catenation}} \subsection{String literal concatenation\label{string-catenation}}
Multiple adjacent string literals (delimited by whitespace), possibly Multiple adjacent string literals (delimited by whitespace), possibly
...@@ -434,6 +446,7 @@ Note that numeric literals do not include a sign; a phrase like ...@@ -434,6 +446,7 @@ Note that numeric literals do not include a sign; a phrase like
\code{-1} is actually an expression composed of the unary operator \code{-1} is actually an expression composed of the unary operator
`\code{-}' and the literal \code{1}. `\code{-}' and the literal \code{1}.
\subsection{Integer and long integer literals\label{integers}} \subsection{Integer and long integer literals\label{integers}}
Integer and long integer literals are described by the following Integer and long integer literals are described by the following
...@@ -468,6 +481,7 @@ Some examples of plain and long integer literals: ...@@ -468,6 +481,7 @@ Some examples of plain and long integer literals:
3L 79228162514264337593543950336L 0377L 0x100000000L 3L 79228162514264337593543950336L 0377L 0x100000000L
\end{verbatim} \end{verbatim}
\subsection{Floating point literals\label{floating}} \subsection{Floating point literals\label{floating}}
Floating point literals are described by the following lexical Floating point literals are described by the following lexical
...@@ -498,6 +512,7 @@ Note that numeric literals do not include a sign; a phrase like ...@@ -498,6 +512,7 @@ Note that numeric literals do not include a sign; a phrase like
\code{-1} is actually an expression composed of the operator \code{-1} is actually an expression composed of the operator
\code{-} and the literal \code{1}. \code{-} and the literal \code{1}.
\subsection{Imaginary literals\label{imaginary}} \subsection{Imaginary literals\label{imaginary}}
Imaginary literals are described by the following lexical definitions: Imaginary literals are described by the following lexical definitions:
...@@ -532,6 +547,7 @@ The comparison operators \code{<>} and \code{!=} are alternate ...@@ -532,6 +547,7 @@ The comparison operators \code{<>} and \code{!=} are alternate
spellings of the same operator. \code{!=} is the preferred spelling; spellings of the same operator. \code{!=} is the preferred spelling;
\code{<>} is obsolescent. \code{<>} is obsolescent.
\section{Delimiters\label{delimiters}} \section{Delimiters\label{delimiters}}
The following tokens serve as delimiters in the grammar: The following tokens serve as delimiters in the grammar:
......
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