[Python-checkins] CVS: python/dist/src/Doc/ref ref2.tex,1.29,1.30
Fred L. Drake
fdrake@users.sourceforge.net
Tue, 14 Aug 2001 14:43:33 -0700
Update of /cvsroot/python/python/dist/src/Doc/ref
In directory usw-pr-cvs1:/tmp/cvs-serv24617/ref
Modified Files:
ref2.tex
Log Message:
Add material about the "r" and "u" prefixes for string literals; should
be reviewed for clarity.
Work around a bogosity in the HTML version of the escape sequences table
conversion.
Index: ref2.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** ref2.tex 2001/08/08 05:37:21 1.29
--- ref2.tex 2001/08/14 21:43:31 1.30
***************
*** 312,316 ****
\begin{productionlist}
\production{stringliteral}
! {\token{shortstring} | \token{longstring}}
\production{shortstring}
{"'" \token{shortstringitem}* "'"
--- 312,318 ----
\begin{productionlist}
\production{stringliteral}
! {[\token{stringprefix}](\token{shortstring} | \token{longstring})}
! \production{stringprefix}
! {"r" | "u" | "ur" | "R" | "U" | "UR" | "Ur" | "uR"}
\production{shortstring}
{"'" \token{shortstringitem}* "'"
***************
*** 326,334 ****
{<any ASCII character except "\e" or newline or the quote>}
\production{longstringchar}
! {<any ASCII character except "\e">}
\production{escapeseq}
{"\e" <any ASCII character>}
\end{productionlist}
\index{triple-quoted string}
\index{Unicode Consortium}
--- 328,340 ----
{<any ASCII character except "\e" or newline or the quote>}
\production{longstringchar}
! {<any ASCII characteru except "\e">}
\production{escapeseq}
{"\e" <any ASCII character>}
\end{productionlist}
+ One syntactic restriction not indicated by these productions is that
+ whitespace is not allowed between the \grammartoken{stringprefix} and
+ the rest of the string literal.
+
\index{triple-quoted string}
\index{Unicode Consortium}
***************
*** 341,350 ****
otherwise have a special meaning, such as newline, backslash itself,
or the quote character. String literals may optionally be prefixed
! with a letter `r' or `R'; such strings are called
! \dfn{raw strings}\index{raw string} and use different rules for
backslash escape sequences. A prefix of 'u' or 'U' makes the string
a Unicode string. Unicode strings use the Unicode character set as
defined by the Unicode Consortium and ISO~10646. Some additional
escape sequences, described below, are available in Unicode strings.
In triple-quoted strings,
--- 347,358 ----
otherwise have a special meaning, such as newline, backslash itself,
or the quote character. String literals may optionally be prefixed
! with a letter `r' or `R'; such strings are called \dfn{raw
! strings}\index{raw string} and use different rules for interpreting
backslash escape sequences. A prefix of 'u' or 'U' makes the string
a Unicode string. Unicode strings use the Unicode character set as
defined by the Unicode Consortium and ISO~10646. Some additional
escape sequences, described below, are available in Unicode strings.
+ The two prefix characters may be combined; in this case, `u' must
+ appear before `r'.
In triple-quoted strings,
***************
*** 375,382 ****
\lineii{\e r} {\ASCII{} Carriage Return (CR)}
\lineii{\e t} {\ASCII{} Horizontal Tab (TAB)}
! \lineii{\e u\var{xxxx}}
! {Character with 16-bit hex value \var{xxxx} (Unicode only)}
! \lineii{\e U\var{xxxxxxxx}}
! {Character with 32-bit hex value \var{xxxxxxxx} (Unicode only)}
\lineii{\e v} {\ASCII{} Vertical Tab (VT)}
\lineii{\e\var{ooo}} {\ASCII{} character with octal value \var{ooo}}
--- 383,388 ----
\lineii{\e r} {\ASCII{} Carriage Return (CR)}
\lineii{\e t} {\ASCII{} Horizontal Tab (TAB)}
! \lineii{\e u\var{xxxx}} {Character with 16-bit hex value \var{xxxx} (Unicode only)}
! \lineii{\e U\var{xxxxxxxx}}{Character with 32-bit hex value \var{xxxxxxxx} (Unicode only)}
\lineii{\e v} {\ASCII{} Vertical Tab (VT)}
\lineii{\e\var{ooo}} {\ASCII{} character with octal value \var{ooo}}