summaryrefslogtreecommitdiffstats
path: root/Doc/ref/ref5.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-03-15 23:21:37 (GMT)
committerFred Drake <fdrake@acm.org>2002-03-15 23:21:37 (GMT)
commit5381588073eced38d37a4cb5ab89d7bd9579b71c (patch)
treedc7860af56cc6a378032ed34735b1c331cf77cd4 /Doc/ref/ref5.tex
parent7fe80a108520479a62edd6adc5eef86f4a058341 (diff)
downloadcpython-5381588073eced38d37a4cb5ab89d7bd9579b71c.zip
cpython-5381588073eced38d37a4cb5ab89d7bd9579b71c.tar.gz
cpython-5381588073eced38d37a4cb5ab89d7bd9579b71c.tar.bz2
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.
Diffstat (limited to 'Doc/ref/ref5.tex')
-rw-r--r--Doc/ref/ref5.tex30
1 files changed, 14 insertions, 16 deletions
diff --git a/Doc/ref/ref5.tex b/Doc/ref/ref5.tex
index 9ed9337..6005f51 100644
--- a/Doc/ref/ref5.tex
+++ b/Doc/ref/ref5.tex
@@ -54,8 +54,8 @@ categorized syntactically as atoms. The syntax for atoms is:
\production{atom}
{\token{identifier} | \token{literal} | \token{enclosure}}
\production{enclosure}
- {\token{parenth_form} | \token{list_display}
- | \token{dict_display} | \token{string_conversion}}
+ {\token{parenth_form} | \token{list_display}}
+ \productioncont{| \token{dict_display} | \token{string_conversion}}
\end{productionlist}
@@ -112,9 +112,8 @@ Python supports string literals and various numeric literals:
\begin{productionlist}
\production{literal}
- {\token{stringliteral} | \token{integer}
- | \token{longinteger} | \token{floatnumber}
- | \token{imagnumber}}
+ {\token{stringliteral} | \token{integer} | \token{longinteger}}
+ \productioncont{| \token{floatnumber} | \token{imagnumber}}
\end{productionlist}
Evaluation of a literal yields an object of the given type (string,
@@ -439,13 +438,12 @@ series of arguments:
\production{call}
{\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}
- }
+ {\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})*}
\production{keyword_arguments}
@@ -666,8 +664,8 @@ operators:
\begin{productionlist}
\production{m_expr}
{\token{u_expr} | \token{m_expr} "*" \token{u_expr}
- | \token{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}
\token{aexpr} "-" \token{m_expr}}
@@ -801,8 +799,8 @@ interpretation that is conventional in mathematics:
\production{comparison}
{\token{or_expr} ( \token{comp_operator} \token{or_expr} )*}
\production{comp_operator}
- {"<" | ">" | "==" | ">=" | "<=" | "<>" | "!="
- | "is" ["not"] | ["not"] "in"}
+ {"<" | ">" | "==" | ">=" | "<=" | "<>" | "!="}
+ \productioncont{| "is" ["not"] | ["not"] "in"}
\end{productionlist}
Comparisons yield integer values: \code{1} for true, \code{0} for false.