|
333 | 333 |
|
334 | 334 | \begin{bnf} |
335 | 335 | \nontermdef{named-universal-character}\br |
336 | | - \terminal{\textbackslash N\{} n-char-sequence \terminal{\}} |
| 336 | + \literalterminal{\textbackslash N\{} n-char-sequence \literalterminal{\}} |
337 | 337 | \end{bnf} |
338 | 338 |
|
339 | 339 | \begin{bnf} |
|
349 | 349 |
|
350 | 350 | \begin{bnf} |
351 | 351 | \nontermdef{universal-character-name}\br |
352 | | - \terminal{\textbackslash u} hex-quad\br |
353 | | - \terminal{\textbackslash U} hex-quad hex-quad\br |
354 | | - \terminal{\textbackslash u\{} simple-hexadecimal-digit-sequence \terminal{\}}\br |
| 352 | + \literalterminal{\textbackslash u} hex-quad\br |
| 353 | + \literalterminal{\textbackslash U} hex-quad hex-quad\br |
| 354 | + \literalterminal{\textbackslash u\{} simple-hexadecimal-digit-sequence \literalterminal{\}}\br |
355 | 355 | named-universal-character |
356 | 356 | \end{bnf} |
357 | 357 |
|
358 | 358 | \pnum |
359 | 359 | A \grammarterm{universal-character-name} |
360 | | -of the form \tcode{\textbackslash u} \grammarterm{hex-quad}, |
361 | | -\tcode{\textbackslash U} \grammarterm{hex-quad} \grammarterm{hex-quad}, or |
362 | | -\tcode{\textbackslash u\{\grammarterm{simple-hexadecimal-digit-sequence}\}} |
| 360 | +of the form \literaltcode{\textbackslash u} \grammarterm{hex-quad}, |
| 361 | +\literaltcode{\textbackslash U} \grammarterm{hex-quad} \grammarterm{hex-quad}, or |
| 362 | +\literaltcode{\textbackslash u\{\grammarterm{simple-hexadecimal-digit-sequence}\}} |
363 | 363 | designates the character in the translation character set |
364 | 364 | whose Unicode scalar value is the hexadecimal number represented by |
365 | 365 | the sequence of \grammarterm{hexadecimal-digit}s |
|
521 | 521 | \item |
522 | 522 | \indextext{literal!string!raw}% |
523 | 523 | If the next character begins a sequence of characters that could be the prefix |
524 | | -and initial double quote of a raw string literal, such as \tcode{R"}, the next preprocessing |
| 524 | +and initial double quote of a raw string literal, such as \literaltcode{R"}, the next preprocessing |
525 | 525 | token shall be a raw string literal. Between the initial and final |
526 | 526 | double quote characters of the raw string, any transformations performed in phase |
527 | 527 | 2 (line splicing) are reverted; this reversion |
528 | 528 | shall apply before any \grammarterm{d-char}, \grammarterm{r-char}, or delimiting |
529 | 529 | parenthesis is identified. The raw string literal is defined as the shortest sequence |
530 | 530 | of characters that matches the raw-string pattern |
531 | 531 | \begin{ncbnf} |
532 | | -\opt{encoding-prefix} \terminal{R} raw-string |
| 532 | +\opt{encoding-prefix} \literalterminal{R} raw-string |
533 | 533 | \end{ncbnf} |
534 | 534 |
|
535 | 535 | \item Otherwise, if the next three characters are \tcode{<::} and the subsequent character |
|
760 | 760 | \begin{bnf} |
761 | 761 | \nontermdef{pp-number}\br |
762 | 762 | digit\br |
763 | | - \terminal{.} digit\br |
| 763 | + \literalterminal{.} digit\br |
764 | 764 | pp-number identifier-continue\br |
765 | | - pp-number \terminal{'} digit\br |
766 | | - pp-number \terminal{'} nondigit\br |
767 | | - pp-number \terminal{e} sign\br |
768 | | - pp-number \terminal{E} sign\br |
769 | | - pp-number \terminal{p} sign\br |
770 | | - pp-number \terminal{P} sign\br |
771 | | - pp-number \terminal{.} |
| 765 | + pp-number \literalterminal{'} digit\br |
| 766 | + pp-number \literalterminal{'} nondigit\br |
| 767 | + pp-number \literalterminal{e} sign\br |
| 768 | + pp-number \literalterminal{E} sign\br |
| 769 | + pp-number \literalterminal{p} sign\br |
| 770 | + pp-number \literalterminal{P} sign\br |
| 771 | + pp-number \literalterminal{.} |
772 | 772 | \end{bnf} |
773 | 773 |
|
774 | 774 | \pnum |
|
1112 | 1112 | \nontermdef{binary-literal}\br |
1113 | 1113 | \terminal{0b} binary-digit\br |
1114 | 1114 | \terminal{0B} binary-digit\br |
1115 | | - binary-literal \opt{\terminal{'}} binary-digit |
| 1115 | + binary-literal \opt{\literalterminal{'}} binary-digit |
1116 | 1116 | \end{bnf} |
1117 | 1117 |
|
1118 | 1118 | \begin{bnf} |
1119 | 1119 | \nontermdef{octal-literal}\br |
1120 | 1120 | \terminal{0}\br |
1121 | | - octal-literal \opt{\terminal{'}} octal-digit |
| 1121 | + octal-literal \opt{\literalterminal{'}} octal-digit |
1122 | 1122 | \end{bnf} |
1123 | 1123 |
|
1124 | 1124 | \begin{bnf} |
1125 | 1125 | \nontermdef{decimal-literal}\br |
1126 | 1126 | nonzero-digit\br |
1127 | | - decimal-literal \opt{\terminal{'}} digit |
| 1127 | + decimal-literal \opt{\literalterminal{'}} digit |
1128 | 1128 | \end{bnf} |
1129 | 1129 |
|
1130 | 1130 | \begin{bnf} |
|
1155 | 1155 | \begin{bnf} |
1156 | 1156 | \nontermdef{hexadecimal-digit-sequence}\br |
1157 | 1157 | hexadecimal-digit\br |
1158 | | - hexadecimal-digit-sequence \opt{\terminal{'}} hexadecimal-digit |
| 1158 | + hexadecimal-digit-sequence \opt{\literalterminal{'}} hexadecimal-digit |
1159 | 1159 | \end{bnf} |
1160 | 1160 |
|
1161 | 1161 | \begin{bnf} |
1162 | 1162 | \nontermdef{hexadecimal-digit} \textnormal{one of}\br |
1163 | | - \terminal{0 1 2 3 4 5 6 7 8 9}\br |
1164 | | - \terminal{a b c d e f}\br |
1165 | | - \terminal{A B C D E F} |
| 1163 | + \literalterminal{0 1 2 3 4 5 6 7 8 9}\br |
| 1164 | + \literalterminal{a b c d e f}\br |
| 1165 | + \literalterminal{A B C D E F} |
1166 | 1166 | \end{bnf} |
1167 | 1167 |
|
1168 | 1168 | \begin{bnf} |
|
1177 | 1177 |
|
1178 | 1178 | \begin{bnf} |
1179 | 1179 | \nontermdef{unsigned-suffix} \textnormal{one of}\br |
1180 | | - \terminal{u U} |
| 1180 | + \literalterminal{u U} |
1181 | 1181 | \end{bnf} |
1182 | 1182 |
|
1183 | 1183 | \begin{bnf} |
1184 | 1184 | \nontermdef{long-suffix} \textnormal{one of}\br |
1185 | | - \terminal{l L} |
| 1185 | + \literalterminal{l L} |
1186 | 1186 | \end{bnf} |
1187 | 1187 |
|
1188 | 1188 | \begin{bnf} |
1189 | 1189 | \nontermdef{long-long-suffix} \textnormal{one of}\br |
1190 | | - \terminal{ll LL} |
| 1190 | + \literalterminal{ll LL} |
1191 | 1191 | \end{bnf} |
1192 | 1192 |
|
1193 | 1193 | \begin{bnf} |
|
1226 | 1226 |
|
1227 | 1227 | \pnum |
1228 | 1228 | The \grammarterm{hexadecimal-digit}s |
1229 | | -\tcode{a} through \tcode{f} and \tcode{A} through \tcode{F} |
| 1229 | +\literaltcode{a} through \literaltcode{f} and \literaltcode{A} through \literaltcode{F} |
1230 | 1230 | have decimal values ten through fifteen. |
1231 | 1231 | \begin{example} |
1232 | 1232 | The number twelve can be written \tcode{12}, \tcode{014}, |
|
1270 | 1270 | & |
1271 | 1271 | & |
1272 | 1272 | \tcode{unsigned long long int}\\\hline |
1273 | | -\tcode{u} or \tcode{U} & |
| 1273 | +\literaltcode{u} or \literaltcode{U} & |
1274 | 1274 | \tcode{unsigned int} & |
1275 | 1275 | \tcode{unsigned int}\\ |
1276 | 1276 | & |
|
1279 | 1279 | & |
1280 | 1280 | \tcode{unsigned long long int} & |
1281 | 1281 | \tcode{unsigned long long int}\\\hline |
1282 | | -\tcode{l} or \tcode{L} & |
| 1282 | +\literaltcode{l} or \literaltcode{L} & |
1283 | 1283 | \tcode{long int} & |
1284 | 1284 | \tcode{long int}\\ |
1285 | 1285 | & |
|
1291 | 1291 | & |
1292 | 1292 | & |
1293 | 1293 | \tcode{unsigned long long int}\\\hline |
1294 | | -Both \tcode{u} or \tcode{U} & |
| 1294 | +Both \literaltcode{u} or \literaltcode{U} & |
1295 | 1295 | \tcode{unsigned long int} & |
1296 | 1296 | \tcode{unsigned long int}\\ |
1297 | | -and \tcode{l} or \tcode{L} & |
| 1297 | +and \literaltcode{l} or \literaltcode{L} & |
1298 | 1298 | \tcode{unsigned long long int} & |
1299 | 1299 | \tcode{unsigned long long int}\\\hline |
1300 | | -\tcode{ll} or \tcode{LL} & |
| 1300 | +\literaltcode{ll} or \literaltcode{LL} & |
1301 | 1301 | \tcode{long long int} & |
1302 | 1302 | \tcode{long long int}\\ |
1303 | 1303 | & |
1304 | 1304 | & |
1305 | 1305 | \tcode{unsigned long long int}\\\hline |
1306 | | -Both \tcode{u} or \tcode{U} & |
| 1306 | +Both \literaltcode{u} or \literaltcode{U} & |
1307 | 1307 | \tcode{unsigned long long int} & |
1308 | 1308 | \tcode{unsigned long long int}\\ |
1309 | | -and \tcode{ll} or \tcode{LL} & |
| 1309 | +and \literaltcode{ll} or \literaltcode{LL} & |
1310 | 1310 | & |
1311 | 1311 | \\\hline |
1312 | 1312 | \tcode{z} or \tcode{Z} & |
|
1354 | 1354 | \indextext{literal!character}% |
1355 | 1355 | \begin{bnf} |
1356 | 1356 | \nontermdef{character-literal}\br |
1357 | | - \opt{encoding-prefix} \terminal{'} c-char-sequence \terminal{'} |
| 1357 | + \opt{encoding-prefix} \literalterminal{'} c-char-sequence \literalterminal{'} |
1358 | 1358 | \end{bnf} |
1359 | 1359 |
|
1360 | 1360 | \begin{bnf} |
1361 | 1361 | \nontermdef{encoding-prefix} \textnormal{one of}\br |
1362 | | - \terminal{u8}\quad\terminal{u}\quad\terminal{U}\quad\terminal{L} |
| 1362 | + \literalterminal{u8}\quad\literalterminal{u}\quad\literalterminal{U}\quad\literalterminal{L} |
1363 | 1363 | \end{bnf} |
1364 | 1364 |
|
1365 | 1365 | \begin{bnf} |
|
1412 | 1412 |
|
1413 | 1413 | \begin{bnf} |
1414 | 1414 | \nontermdef{octal-escape-sequence}\br |
1415 | | - \terminal{\textbackslash} octal-digit\br |
1416 | | - \terminal{\textbackslash} octal-digit octal-digit\br |
1417 | | - \terminal{\textbackslash} octal-digit octal-digit octal-digit\br |
1418 | | - \terminal{\textbackslash o\{} simple-octal-digit-sequence \terminal{\}}\br |
| 1415 | + \literalterminal{\textbackslash} octal-digit\br |
| 1416 | + \literalterminal{\textbackslash} octal-digit octal-digit\br |
| 1417 | + \literalterminal{\textbackslash} octal-digit octal-digit octal-digit\br |
| 1418 | + \literalterminal{\textbackslash o\{} simple-octal-digit-sequence \literalterminal{\}}\br |
1419 | 1419 | \end{bnf} |
1420 | 1420 |
|
1421 | 1421 | \begin{bnf} |
1422 | 1422 | \nontermdef{hexadecimal-escape-sequence}\br |
1423 | | - \terminal{\textbackslash x} simple-hexadecimal-digit-sequence\br |
1424 | | - \terminal{\textbackslash x\{} simple-hexadecimal-digit-sequence \terminal{\}} |
| 1423 | + \literalterminal{\textbackslash x} simple-hexadecimal-digit-sequence\br |
| 1424 | + \literalterminal{\textbackslash x\{} simple-hexadecimal-digit-sequence \literalterminal{\}} |
1425 | 1425 | \end{bnf} |
1426 | 1426 |
|
1427 | 1427 | \begin{bnf} |
|
1609 | 1609 |
|
1610 | 1610 | \begin{bnf} |
1611 | 1611 | \nontermdef{fractional-constant}\br |
1612 | | - \opt{digit-sequence} \terminal{.} digit-sequence\br |
1613 | | - digit-sequence \terminal{.} |
| 1612 | + \opt{digit-sequence} \literalterminal{.} digit-sequence\br |
| 1613 | + digit-sequence \literalterminal{.} |
1614 | 1614 | \end{bnf} |
1615 | 1615 |
|
1616 | 1616 | \begin{bnf} |
1617 | 1617 | \nontermdef{hexadecimal-fractional-constant}\br |
1618 | | - \opt{hexadecimal-digit-sequence} \terminal{.} hexadecimal-digit-sequence\br |
1619 | | - hexadecimal-digit-sequence \terminal{.} |
| 1618 | + \opt{hexadecimal-digit-sequence} \literalterminal{.} hexadecimal-digit-sequence\br |
| 1619 | + hexadecimal-digit-sequence \literalterminal{.} |
1620 | 1620 | \end{bnf} |
1621 | 1621 |
|
1622 | 1622 | \begin{bnf} |
1623 | 1623 | \nontermdef{exponent-part}\br |
1624 | | - \terminal{e} \opt{sign} digit-sequence\br |
1625 | | - \terminal{E} \opt{sign} digit-sequence |
| 1624 | + \literalterminal{e} \opt{sign} digit-sequence\br |
| 1625 | + \literalterminal{E} \opt{sign} digit-sequence |
1626 | 1626 | \end{bnf} |
1627 | 1627 |
|
1628 | 1628 | \begin{bnf} |
1629 | 1629 | \nontermdef{binary-exponent-part}\br |
1630 | | - \terminal{p} \opt{sign} digit-sequence\br |
1631 | | - \terminal{P} \opt{sign} digit-sequence |
| 1630 | + \literalterminal{p} \opt{sign} digit-sequence\br |
| 1631 | + \literalterminal{P} \opt{sign} digit-sequence |
1632 | 1632 | \end{bnf} |
1633 | 1633 |
|
1634 | 1634 | \begin{bnf} |
1635 | 1635 | \nontermdef{sign} \textnormal{one of}\br |
1636 | | - \terminal{+ -} |
| 1636 | + \literalterminal{+ -} |
1637 | 1637 | \end{bnf} |
1638 | 1638 |
|
1639 | 1639 | \begin{bnf} |
1640 | 1640 | \nontermdef{digit-sequence}\br |
1641 | 1641 | digit\br |
1642 | | - digit-sequence \opt{\terminal{'}} digit |
| 1642 | + digit-sequence \opt{\literalterminal{'}} digit |
1643 | 1643 | \end{bnf} |
1644 | 1644 |
|
1645 | 1645 | \begin{bnf} |
1646 | 1646 | \nontermdef{floating-point-suffix} \textnormal{one of}\br |
1647 | | - \terminal{f l f16 f32 f64 f128 bf16 F L F16 F32 F64 F128 BF16} |
| 1647 | + \literalterminal{f l f16 f32 f64 f128 bf16 F L F16 F32 F64 F128 BF16} |
1648 | 1648 | \end{bnf} |
1649 | 1649 |
|
1650 | 1650 | \pnum |
|
1672 | 1672 | \topline |
1673 | 1673 | \lhdr{\grammarterm{floating-point-suffix}} & \rhdr{type} \\ \capsep |
1674 | 1674 | none & \keyword{double} \\ |
1675 | | -\tcode{f} or \tcode{F} & \keyword {float} \\ |
1676 | | -\tcode{l} or \tcode{L} & \keyword{long} \keyword{double} \\ |
1677 | | -\tcode{f16} or \tcode{F16} & \tcode{std::float16_t} \\ |
1678 | | -\tcode{f32} or \tcode{F32} & \tcode{std::float32_t} \\ |
1679 | | -\tcode{f64} or \tcode{F64} & \tcode{std::float64_t} \\ |
1680 | | -\tcode{f128} or \tcode{F128} & \tcode{std::float128_t} \\ |
1681 | | -\tcode{bf16} or \tcode{BF16} & \tcode{std::bfloat16_t} \\ |
| 1675 | +\literaltcode{f} or \literaltcode{F} & \keyword {float} \\ |
| 1676 | +\literaltcode{l} or \literaltcode{L} & \keyword{long} \keyword{double} \\ |
| 1677 | +\literaltcode{f16} or \literaltcode{F16} & \literaltcode{std::float16_t} \\ |
| 1678 | +\literaltcode{f32} or \literaltcode{F32} & \literaltcode{std::float32_t} \\ |
| 1679 | +\literaltcode{f64} or \literaltcode{F64} & \literaltcode{std::float64_t} \\ |
| 1680 | +\literaltcode{f128} or \literaltcode{F128} & \literaltcode{std::float128_t} \\ |
| 1681 | +\literaltcode{bf16} or \literaltcode{BF16} & \literaltcode{std::bfloat16_t} \\ |
1682 | 1682 | \end{simpletypetable} |
1683 | 1683 |
|
1684 | 1684 | \pnum |
|
1729 | 1729 | \indextext{literal!string}% |
1730 | 1730 | \begin{bnf} |
1731 | 1731 | \nontermdef{string-literal}\br |
1732 | | - \opt{encoding-prefix} \terminal{"} \opt{s-char-sequence} \terminal{"}\br |
1733 | | - \opt{encoding-prefix} \terminal{R} raw-string |
| 1732 | + \opt{encoding-prefix} \literalterminal{"} \opt{s-char-sequence} \literalterminal{"}\br |
| 1733 | + \opt{encoding-prefix} \literalterminal{R} raw-string |
1734 | 1734 | \end{bnf} |
1735 | 1735 |
|
1736 | 1736 | \begin{bnf} |
|
1754 | 1754 |
|
1755 | 1755 | \begin{bnf} |
1756 | 1756 | \nontermdef{raw-string}\br |
1757 | | - \terminal{"} \opt{d-char-sequence} \terminal{(} \opt{r-char-sequence} \terminal{)} \opt{d-char-sequence} \terminal{"} |
| 1757 | + \literalterminal{"} \opt{d-char-sequence} \literalterminal{(} \opt{r-char-sequence} \literalterminal{)} \opt{d-char-sequence} \literalterminal{"} |
1758 | 1758 | \end{bnf} |
1759 | 1759 |
|
1760 | 1760 | \begin{bnf} |
|
1841 | 1841 |
|
1842 | 1842 | \pnum |
1843 | 1843 | \indextext{literal!string!raw}% |
1844 | | -A \grammarterm{string-literal} that has an \tcode{R} |
| 1844 | +A \grammarterm{string-literal} that has an \literaltcode{R} |
1845 | 1845 | \indextext{prefix!\idxcode{R}}% |
1846 | 1846 | in the prefix is a \defn{raw string literal}. The |
1847 | 1847 | \grammarterm{d-char-sequence} serves as a delimiter. The terminating |
|
0 commit comments