[Python-checkins] CVS: python/dist/src/Doc/ref ref2.tex,1.34,1.35 ref5.tex,1.53,1.54 ref6.tex,1.47,1.48 ref7.tex,1.31,1.32 refa1.tex,1.10,1.11
Fred L. Drake
fdrake@users.sourceforge.net
Fri, 15 Mar 2002 15:21:39 -0800
Update of /cvsroot/python/python/dist/src/Doc/ref
In directory usw-pr-cvs1:/tmp/cvs-serv21631/ref
Modified Files:
ref2.tex ref5.tex ref6.tex ref7.tex refa1.tex
Log Message:
Revise the markup related to the grammar productions to increase the
level of predictability. This is not really "good" markup, but is arguably
better than we had before.
This closes SF bug #523117.
Index: ref2.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** ref2.tex 11 Dec 2001 17:46:38 -0000 1.34
--- ref2.tex 15 Mar 2002 23:21:37 -0000 1.35
***************
*** 319,324 ****
| '"' \token{shortstringitem}* '"'}
\production{longstring}
! {"'''" \token{longstringitem}* "'''"
! | '"""' \token{longstringitem}* '"""'}
\production{shortstringitem}
{\token{shortstringchar} | \token{escapeseq}}
--- 319,324 ----
| '"' \token{shortstringitem}* '"'}
\production{longstring}
! {"'''" \token{longstringitem}* "'''"}
! \productioncont{| '"""' \token{longstringitem}* '"""'}
\production{shortstringitem}
{\token{shortstringchar} | \token{escapeseq}}
Index: ref5.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref5.tex,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** ref5.tex 14 Dec 2001 16:57:31 -0000 1.53
--- ref5.tex 15 Mar 2002 23:21:37 -0000 1.54
***************
*** 55,60 ****
{\token{identifier} | \token{literal} | \token{enclosure}}
\production{enclosure}
! {\token{parenth_form} | \token{list_display}
! | \token{dict_display} | \token{string_conversion}}
\end{productionlist}
--- 55,60 ----
{\token{identifier} | \token{literal} | \token{enclosure}}
\production{enclosure}
! {\token{parenth_form} | \token{list_display}}
! \productioncont{| \token{dict_display} | \token{string_conversion}}
\end{productionlist}
***************
*** 113,119 ****
\begin{productionlist}
\production{literal}
! {\token{stringliteral} | \token{integer}
! | \token{longinteger} | \token{floatnumber}
! | \token{imagnumber}}
\end{productionlist}
--- 113,118 ----
\begin{productionlist}
\production{literal}
! {\token{stringliteral} | \token{integer} | \token{longinteger}}
! \productioncont{| \token{floatnumber} | \token{imagnumber}}
\end{productionlist}
***************
*** 440,450 ****
{\token{primary} "(" [\token{argument_list} [","]] ")"}
\production{argument_list}
! {\token{positional_arguments} ["," \token{keyword_arguments}
! ["," "*" \token{expression} ["," "**" \token{expression}]]]
! | \token{keyword_arguments} ["," "*" \token{expression}
! ["," "**" \token{expression}]]
! | "*" \token{expression} ["," "**" \token{expression}]
! | "**" \token{expression}
! }
\production{positional_arguments}
{\token{expression} ("," \token{expression})*}
--- 439,448 ----
{\token{primary} "(" [\token{argument_list} [","]] ")"}
\production{argument_list}
! {\token{positional_arguments} ["," \token{keyword_arguments}}
! \productioncont{ ["," "*" \token{expression} ["," "**" \token{expression}]]]}
! \productioncont{| \token{keyword_arguments} ["," "*" \token{expression}}
! \productioncont{ ["," "**" \token{expression}]]}
! \productioncont{| "*" \token{expression} ["," "**" \token{expression}]}
! \productioncont{| "**" \token{expression}}
\production{positional_arguments}
{\token{expression} ("," \token{expression})*}
***************
*** 667,672 ****
\production{m_expr}
{\token{u_expr} | \token{m_expr} "*" \token{u_expr}
! | \token{m_expr} "/" \token{u_expr}
! | \token{m_expr} "\%" \token{u_expr}}
\production{a_expr}
{\token{m_expr} | \token{aexpr} "+" \token{m_expr}
--- 665,670 ----
\production{m_expr}
{\token{u_expr} | \token{m_expr} "*" \token{u_expr}
! | \token{m_expr} "/" \token{u_expr}}
! \productioncont{| \token{m_expr} "\%" \token{u_expr}}
\production{a_expr}
{\token{m_expr} | \token{aexpr} "+" \token{m_expr}
***************
*** 802,807 ****
{\token{or_expr} ( \token{comp_operator} \token{or_expr} )*}
\production{comp_operator}
! {"<" | ">" | "==" | ">=" | "<=" | "<>" | "!="
! | "is" ["not"] | ["not"] "in"}
\end{productionlist}
--- 800,805 ----
{\token{or_expr} ( \token{comp_operator} \token{or_expr} )*}
\production{comp_operator}
! {"<" | ">" | "==" | ">=" | "<=" | "<>" | "!="}
! \productioncont{| "is" ["not"] | ["not"] "in"}
\end{productionlist}
Index: ref6.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** ref6.tex 14 Dec 2001 22:55:14 -0000 1.47
--- ref6.tex 15 Mar 2002 23:21:37 -0000 1.48
***************
*** 7,26 ****
\begin{productionlist}
! \production{simple_stmt}
! {\token{expression_stmt}
! | \token{assert_stmt}
! | \token{assignment_stmt}
! | \token{augmented_assignment_stmt}
! | \token{pass_stmt}
! | \token{del_stmt}
! | \token{print_stmt}
! | \token{return_stmt}
! | \token{yield_stmt}
! | \token{raise_stmt}
! | \token{break_stmt}
! | \token{continue_stmt}
! | \token{import_stmt}
! | \token{global_stmt}
! | \token{exec_stmt}}
\end{productionlist}
--- 7,25 ----
\begin{productionlist}
! \production{simple_stmt}{\token{expression_stmt}}
! \productioncont{| \token{assert_stmt}}
! \productioncont{| \token{assignment_stmt}}
! \productioncont{| \token{augmented_assignment_stmt}}
! \productioncont{| \token{pass_stmt}}
! \productioncont{| \token{del_stmt}}
! \productioncont{| \token{print_stmt}}
! \productioncont{| \token{return_stmt}}
! \productioncont{| \token{yield_stmt}}
! \productioncont{| \token{raise_stmt}}
! \productioncont{| \token{break_stmt}}
! \productioncont{| \token{continue_stmt}}
! \productioncont{| \token{import_stmt}}
! \productioncont{| \token{global_stmt}}
! \productioncont{| \token{exec_stmt}}
\end{productionlist}
***************
*** 113,122 ****
{\token{target} ("," \token{target})* [","]}
\production{target}
! {\token{identifier}
! | "(" \token{target_list} ")"
! | "[" \token{target_list} "]"
! | \token{attributeref}
! | \token{subscription}
! | \token{slicing}}
\end{productionlist}
--- 112,121 ----
{\token{target} ("," \token{target})* [","]}
\production{target}
! {\token{identifier}}
! \productioncont{| "(" \token{target_list} ")"}
! \productioncont{| "[" \token{target_list} "]"}
! \productioncont{| \token{attributeref}}
! \productioncont{| \token{subscription}}
! \productioncont{| \token{slicing}}
\end{productionlist}
***************
*** 265,269 ****
! \subsection{Augmented Assignment statements \label{augassign}}
Augmented assignment is the combination, in a single statement, of a binary
--- 264,268 ----
! \subsection{Augmented assignment statements \label{augassign}}
Augmented assignment is the combination, in a single statement, of a binary
***************
*** 276,288 ****
{\token{target} \token{augop} \token{expression_list}}
\production{augop}
! {"+=" | "-=" | "*=" | "/=" | "\%=" | "**="
! | ">>=" | "<<=" | "\&=" | "\textasciicircum=" | "|="}
! \production{target}
! {\token{identifier}
! | "(" \token{target_list} ")"
! | "[" \token{target_list} "]"
! | \token{attributeref}
! | \token{subscription}
! | \token{slicing}}
\end{productionlist}
--- 275,280 ----
{\token{target} \token{augop} \token{expression_list}}
\production{augop}
! {"+=" | "-=" | "*=" | "/=" | "\%=" | "**="}
! \productioncont{| ">>=" | "<<=" | "\&=" | "\textasciicircum=" | "|="}
\end{productionlist}
***************
*** 365,371 ****
\begin{productionlist}
\production{print_stmt}
! {"print" ( \optional{\token{expression} ("," \token{expression})* \optional{","}}
! | ">\code{>}" \token{expression}
! \optional{("," \token{expression})+ \optional{","}})}
\end{productionlist}
--- 357,363 ----
\begin{productionlist}
\production{print_stmt}
! {"print" ( \optional{\token{expression} ("," \token{expression})* \optional{","}}}
! \productioncont{| ">\code{>}" \token{expression}
! \optional{("," \token{expression})+ \optional{","}} )}
\end{productionlist}
***************
*** 601,609 ****
\production{import_stmt}
{"import" \token{module} ["as" \token{name}]
! ( "," \token{module} ["as" \token{name}] )*
! | "from" \token{module} "import" \token{identifier}
! ["as" \token{name}]
! ( "," \token{identifier} ["as" \token{name}] )*
! | "from" \token{module} "import" "*"}
\production{module}
{(\token{identifier} ".")* \token{identifier}}
--- 593,601 ----
\production{import_stmt}
{"import" \token{module} ["as" \token{name}]
! ( "," \token{module} ["as" \token{name}] )*}
! \productioncont{| "from" \token{module} "import" \token{identifier}
! ["as" \token{name}]}
! \productioncont{ ( "," \token{identifier} ["as" \token{name}] )*}
! \productioncont{| "from" \token{module} "import" "*"}
\production{module}
{(\token{identifier} ".")* \token{identifier}}
Index: ref7.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** ref7.tex 22 Feb 2002 15:40:23 -0000 1.31
--- ref7.tex 15 Mar 2002 23:21:37 -0000 1.32
***************
*** 43,48 ****
\begin{productionlist}
\production{compound_stmt}
! {\token{if_stmt} | \token{while_stmt} | \token{for_stmt}
! | \token{try_stmt} | \token{funcdef} | \token{classdef}}
\production{suite}
{\token{stmt_list} NEWLINE
--- 43,52 ----
\begin{productionlist}
\production{compound_stmt}
! {\token{if_stmt}}
! \productioncont{| \token{while_stmt}}
! \productioncont{| \token{for_stmt}}
! \productioncont{| \token{try_stmt}}
! \productioncont{| \token{funcdef}}
! \productioncont{| \token{classdef}}
\production{suite}
{\token{stmt_list} NEWLINE
***************
*** 74,80 ****
\begin{productionlist}
\production{if_stmt}
! {"if" \token{expression} ":" \token{suite}
! ( "elif" \token{expression} ":" \token{suite} )*
! ["else" ":" \token{suite}]}
\end{productionlist}
--- 78,84 ----
\begin{productionlist}
\production{if_stmt}
! {"if" \token{expression} ":" \token{suite}}
! \productioncont{( "elif" \token{expression} ":" \token{suite} )*}
! \productioncont{["else" ":" \token{suite}]}
\end{productionlist}
***************
*** 98,103 ****
\begin{productionlist}
\production{while_stmt}
! {"while" \token{expression} ":" \token{suite}
! ["else" ":" \token{suite}]}
\end{productionlist}
--- 102,107 ----
\begin{productionlist}
\production{while_stmt}
! {"while" \token{expression} ":" \token{suite}}
! \productioncont{["else" ":" \token{suite}]}
\end{productionlist}
***************
*** 127,132 ****
\production{for_stmt}
{"for" \token{target_list} "in" \token{expression_list}
! ":" \token{suite}
! ["else" ":" \token{suite}]}
\end{productionlist}
--- 131,136 ----
\production{for_stmt}
{"for" \token{target_list} "in" \token{expression_list}
! ":" \token{suite}}
! \productioncont{["else" ":" \token{suite}]}
\end{productionlist}
***************
*** 193,200 ****
{\token{try_exc_stmt} | \token{try_fin_stmt}}
\production{try_exc_stmt}
! {"try" ":" \token{suite}
! ("except" [\token{expression} ["," \token{target}]] ":"
! \token{suite})+
! ["else" ":" \token{suite}]}
\production{try_fin_stmt}
{"try" ":" \token{suite}
--- 197,204 ----
{\token{try_exc_stmt} | \token{try_fin_stmt}}
\production{try_exc_stmt}
! {"try" ":" \token{suite}}
! \productioncont{("except" [\token{expression}
! ["," \token{target}]] ":" \token{suite})+}
! \productioncont{["else" ":" \token{suite}]}
\production{try_fin_stmt}
{"try" ":" \token{suite}
***************
*** 311,318 ****
":" \token{suite}}
\production{parameter_list}
! {(\token{defparameter} ",")*
! ("*" \token{identifier} [, "**" \token{identifier}]
! | "**" \token{identifier}
! | \token{defparameter} [","])}
\production{defparameter}
{\token{parameter} ["=" \token{expression}]}
--- 315,322 ----
":" \token{suite}}
\production{parameter_list}
! {(\token{defparameter} ",")*}
! \productioncont{("*" \token{identifier} [, "**" \token{identifier}]}
! \productioncont{| "**" \token{identifier}
! | \token{defparameter} [","])}
\production{defparameter}
{\token{parameter} ["=" \token{expression}]}
Index: refa1.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/refa1.tex,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** refa1.tex 21 Jan 2002 16:09:18 -0000 1.10
--- refa1.tex 15 Mar 2002 23:21:37 -0000 1.11
***************
*** 21,31 ****
before the release in which the feature becomes standard.
! \begin{verbatim}
! future_statement: "from" "__future__" "import" feature ["as" name]
! ("," feature ["as" name])*
!
! feature: identifier
! name: identifier
! \end{verbatim}
A future statement must appear near the top of the module. The only
--- 21,31 ----
before the release in which the feature becomes standard.
! \begin{productionlist}[*]
! \production{future_statement}
! {"from" "__future__" "import" feature ["as" name]}
! \productioncont{("," feature ["as" name])*}
! \production{feature}{identifier}
! \production{name}{identifier}
! \end{productionlist}
A future statement must appear near the top of the module. The only