diff --git a/source/lex.tex b/source/lex.tex index 8005b33374..0385a92363 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -613,7 +613,7 @@ parenthesis is identified. The raw string literal is defined as the shortest sequence of characters that matches the raw-string pattern \begin{ncbnf} -\opt{encoding-prefix} \terminal{R} raw-string +\opt{encoding-prefix} raw-string \end{ncbnf} \item Otherwise, if the next three characters are \tcode{<::} and the subsequent character @@ -1799,8 +1799,13 @@ \indextext{literal!string}% \begin{bnf} \nontermdef{string-literal}\br - \opt{encoding-prefix} \terminal{"} \opt{s-char-sequence} \terminal{"}\br - \opt{encoding-prefix} \terminal{R} raw-string + \opt{encoding-prefix} plain-string-literal\br + \opt{encoding-prefix} raw-string +\end{bnf} + +\begin{bnf} +\nontermdef{plain-string-literal}\br + \terminal{"} \opt{s-char-sequence} \terminal{"} \end{bnf} \begin{bnf} @@ -1823,7 +1828,7 @@ \begin{bnf} \nontermdef{raw-string}\br - \terminal{"} \opt{d-char-sequence} \terminal{(} \opt{r-char-sequence} \terminal{)} \opt{d-char-sequence} \terminal{"} + \terminal{R} \terminal{"} \opt{d-char-sequence} \terminal{(} \opt{r-char-sequence} \terminal{)} \opt{d-char-sequence} \terminal{"} \end{bnf} \begin{bnf} @@ -2110,12 +2115,10 @@ \begin{bnf} \nontermdef{unevaluated-string}\br - string-literal + plain-string-literal\br + raw-string \end{bnf} -\pnum -An \grammarterm{unevaluated-string} shall have no \grammarterm{encoding-prefix}. - \pnum Each \grammarterm{universal-character-name} and each \grammarterm{simple-escape-sequence} in an \grammarterm{unevaluated-string} is replaced by the member of the translation character set it denotes. diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 5b82675e1d..50af810187 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1805,7 +1805,7 @@ token in the replacement list. \pnum -A \defn{character string literal} is a \grammarterm{string-literal} with no prefix. +A \defn{character string literal} is a \grammarterm{plain-string-literal}. If, in the replacement list, a parameter is immediately preceded by a \tcode{\#} @@ -2070,12 +2070,6 @@ \indextext{preprocessing directive!line control}% \indextext{\idxcode{\#line}|see{preprocessing directive, line control}} -\pnum -The \grammarterm{string-literal} of a -\tcode{\#line} -directive, if present, -shall be a character string literal. - \pnum The \defn{line number} @@ -2102,11 +2096,11 @@ \pnum A preprocessing directive of the form \begin{ncsimplebnf} -\terminal{\# line} digit-sequence \terminal{"} \opt{s-char-sequence} \terminal{"} new-line +\terminal{\# line} digit-sequence plain-string-literal new-line \end{ncsimplebnf} sets the presumed line number similarly and changes the presumed name of the source file to be the contents -of the character string literal. +of the \grammarterm{plain-string-literal}. \pnum A preprocessing directive of the form