|
566 | 566 | \item
|
567 | 567 | \indextext{literal!string!raw}%
|
568 | 568 | If the next character begins a sequence of characters that could be the prefix
|
569 |
| -and initial double quote of a raw string literal, such as \tcode{R"}, the next preprocessing |
| 569 | +and initial double quote of a raw string literal, such as \literaltcode{R"}, the next preprocessing |
570 | 570 | token shall be a raw string literal. Between the initial and final
|
571 | 571 | double quote characters of the raw string, any transformations performed in phase
|
572 | 572 | 2 (line splicing) are reverted; this reversion
|
573 | 573 | shall apply before any \grammarterm{d-char}, \grammarterm{r-char}, or delimiting
|
574 | 574 | parenthesis is identified. The raw string literal is defined as the shortest sequence
|
575 | 575 | of characters that matches the raw-string pattern
|
576 | 576 | \begin{ncbnf}
|
577 |
| -\opt{encoding-prefix} \terminal{R} raw-string |
| 577 | +\opt{encoding-prefix} \literalterminal{R} raw-string |
578 | 578 | \end{ncbnf}
|
579 | 579 |
|
580 | 580 | \item Otherwise, if the next three characters are \tcode{<::} and the subsequent character
|
|
694 | 694 | \begin{bnf}
|
695 | 695 | \nontermdef{pp-number}\br
|
696 | 696 | digit\br
|
697 |
| - \terminal{.} digit\br |
| 697 | + \literalterminal{.} digit\br |
698 | 698 | pp-number identifier-continue\br
|
699 |
| - pp-number \terminal{'} digit\br |
700 |
| - pp-number \terminal{'} nondigit\br |
701 |
| - pp-number \terminal{e} sign\br |
702 |
| - pp-number \terminal{E} sign\br |
703 |
| - pp-number \terminal{p} sign\br |
704 |
| - pp-number \terminal{P} sign\br |
705 |
| - pp-number \terminal{.} |
| 699 | + pp-number \literalterminal{'} digit\br |
| 700 | + pp-number \literalterminal{'} nondigit\br |
| 701 | + pp-number \literalterminal{e} sign\br |
| 702 | + pp-number \literalterminal{E} sign\br |
| 703 | + pp-number \literalterminal{p} sign\br |
| 704 | + pp-number \literalterminal{P} sign\br |
| 705 | + pp-number \literalterminal{.} |
706 | 706 | \end{bnf}
|
707 | 707 |
|
708 | 708 | \pnum
|
|
1124 | 1124 | \nontermdef{binary-literal}\br
|
1125 | 1125 | \terminal{0b} binary-digit\br
|
1126 | 1126 | \terminal{0B} binary-digit\br
|
1127 |
| - binary-literal \opt{\terminal{'}} binary-digit |
| 1127 | + binary-literal \opt{\literalterminal{'}} binary-digit |
1128 | 1128 | \end{bnf}
|
1129 | 1129 |
|
1130 | 1130 | \begin{bnf}
|
1131 | 1131 | \nontermdef{octal-literal}\br
|
1132 | 1132 | \terminal{0}\br
|
1133 |
| - octal-literal \opt{\terminal{'}} octal-digit |
| 1133 | + octal-literal \opt{\literalterminal{'}} octal-digit |
1134 | 1134 | \end{bnf}
|
1135 | 1135 |
|
1136 | 1136 | \begin{bnf}
|
1137 | 1137 | \nontermdef{decimal-literal}\br
|
1138 | 1138 | nonzero-digit\br
|
1139 |
| - decimal-literal \opt{\terminal{'}} digit |
| 1139 | + decimal-literal \opt{\literalterminal{'}} digit |
1140 | 1140 | \end{bnf}
|
1141 | 1141 |
|
1142 | 1142 | \begin{bnf}
|
|
1167 | 1167 | \begin{bnf}
|
1168 | 1168 | \nontermdef{hexadecimal-digit-sequence}\br
|
1169 | 1169 | hexadecimal-digit\br
|
1170 |
| - hexadecimal-digit-sequence \opt{\terminal{'}} hexadecimal-digit |
| 1170 | + hexadecimal-digit-sequence \opt{\literalterminal{'}} hexadecimal-digit |
1171 | 1171 | \end{bnf}
|
1172 | 1172 |
|
1173 | 1173 | \begin{bnf}
|
1174 | 1174 | \nontermdef{hexadecimal-digit} \textnormal{one of}\br
|
1175 |
| - \terminal{0 1 2 3 4 5 6 7 8 9}\br |
1176 |
| - \terminal{a b c d e f}\br |
1177 |
| - \terminal{A B C D E F} |
| 1175 | + \literalterminal{0 1 2 3 4 5 6 7 8 9}\br |
| 1176 | + \literalterminal{a b c d e f}\br |
| 1177 | + \literalterminal{A B C D E F} |
1178 | 1178 | \end{bnf}
|
1179 | 1179 |
|
1180 | 1180 | \begin{bnf}
|
|
1189 | 1189 |
|
1190 | 1190 | \begin{bnf}
|
1191 | 1191 | \nontermdef{unsigned-suffix} \textnormal{one of}\br
|
1192 |
| - \terminal{u U} |
| 1192 | + \literalterminal{u U} |
1193 | 1193 | \end{bnf}
|
1194 | 1194 |
|
1195 | 1195 | \begin{bnf}
|
1196 | 1196 | \nontermdef{long-suffix} \textnormal{one of}\br
|
1197 |
| - \terminal{l L} |
| 1197 | + \literalterminal{l L} |
1198 | 1198 | \end{bnf}
|
1199 | 1199 |
|
1200 | 1200 | \begin{bnf}
|
1201 | 1201 | \nontermdef{long-long-suffix} \textnormal{one of}\br
|
1202 |
| - \terminal{ll LL} |
| 1202 | + \literalterminal{ll LL} |
1203 | 1203 | \end{bnf}
|
1204 | 1204 |
|
1205 | 1205 | \begin{bnf}
|
|
1238 | 1238 |
|
1239 | 1239 | \pnum
|
1240 | 1240 | The \grammarterm{hexadecimal-digit}s
|
1241 |
| -\tcode{a} through \tcode{f} and \tcode{A} through \tcode{F} |
| 1241 | +\literaltcode{a} through \literaltcode{f} and \literaltcode{A} through \literaltcode{F} |
1242 | 1242 | have decimal values ten through fifteen.
|
1243 | 1243 | \begin{example}
|
1244 | 1244 | The number twelve can be written \tcode{12}, \tcode{014},
|
|
1282 | 1282 | &
|
1283 | 1283 | &
|
1284 | 1284 | \tcode{unsigned long long int}\\\hline
|
1285 |
| -\tcode{u} or \tcode{U} & |
| 1285 | +\literaltcode{u} or \literaltcode{U} & |
1286 | 1286 | \tcode{unsigned int} &
|
1287 | 1287 | \tcode{unsigned int}\\
|
1288 | 1288 | &
|
|
1291 | 1291 | &
|
1292 | 1292 | \tcode{unsigned long long int} &
|
1293 | 1293 | \tcode{unsigned long long int}\\\hline
|
1294 |
| -\tcode{l} or \tcode{L} & |
| 1294 | +\literaltcode{l} or \literaltcode{L} & |
1295 | 1295 | \tcode{long int} &
|
1296 | 1296 | \tcode{long int}\\
|
1297 | 1297 | &
|
|
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 int} &
|
1308 | 1308 | \tcode{unsigned long int}\\
|
1309 |
| -and \tcode{l} or \tcode{L} & |
| 1309 | +and \literaltcode{l} or \literaltcode{L} & |
1310 | 1310 | \tcode{unsigned long long int} &
|
1311 | 1311 | \tcode{unsigned long long int}\\\hline
|
1312 |
| -\tcode{ll} or \tcode{LL} & |
| 1312 | +\literaltcode{ll} or \literaltcode{LL} & |
1313 | 1313 | \tcode{long long int} &
|
1314 | 1314 | \tcode{long long int}\\
|
1315 | 1315 | &
|
1316 | 1316 | &
|
1317 | 1317 | \tcode{unsigned long long int}\\\hline
|
1318 |
| -Both \tcode{u} or \tcode{U} & |
| 1318 | +Both \literaltcode{u} or \literaltcode{U} & |
1319 | 1319 | \tcode{unsigned long long int} &
|
1320 | 1320 | \tcode{unsigned long long int}\\
|
1321 |
| -and \tcode{ll} or \tcode{LL} & |
| 1321 | +and \literaltcode{ll} or \literaltcode{LL} & |
1322 | 1322 | &
|
1323 | 1323 | \\\hline
|
1324 | 1324 | \tcode{z} or \tcode{Z} &
|
|
1366 | 1366 | \indextext{literal!character}%
|
1367 | 1367 | \begin{bnf}
|
1368 | 1368 | \nontermdef{character-literal}\br
|
1369 |
| - \opt{encoding-prefix} \terminal{'} c-char-sequence \terminal{'} |
| 1369 | + \opt{encoding-prefix} \literalterminal{'} c-char-sequence \literalterminal{'} |
1370 | 1370 | \end{bnf}
|
1371 | 1371 |
|
1372 | 1372 | \begin{bnf}
|
1373 | 1373 | \nontermdef{encoding-prefix} \textnormal{one of}\br
|
1374 |
| - \terminal{u8}\quad\terminal{u}\quad\terminal{U}\quad\terminal{L} |
| 1374 | + \literalterminal{u8}\quad\literalterminal{u}\quad\literalterminal{U}\quad\literalterminal{L} |
1375 | 1375 | \end{bnf}
|
1376 | 1376 |
|
1377 | 1377 | \begin{bnf}
|
|
1424 | 1424 |
|
1425 | 1425 | \begin{bnf}
|
1426 | 1426 | \nontermdef{octal-escape-sequence}\br
|
1427 |
| - \terminal{\textbackslash} octal-digit\br |
1428 |
| - \terminal{\textbackslash} octal-digit octal-digit\br |
1429 |
| - \terminal{\textbackslash} octal-digit octal-digit octal-digit\br |
1430 |
| - \terminal{\textbackslash o\{} simple-octal-digit-sequence \terminal{\}}\br |
| 1427 | + \literalterminal{\textbackslash} octal-digit\br |
| 1428 | + \literalterminal{\textbackslash} octal-digit octal-digit\br |
| 1429 | + \literalterminal{\textbackslash} octal-digit octal-digit octal-digit\br |
| 1430 | + \literalterminal{\textbackslash o\{} simple-octal-digit-sequence \literalterminal{\}}\br |
1431 | 1431 | \end{bnf}
|
1432 | 1432 |
|
1433 | 1433 | \begin{bnf}
|
1434 | 1434 | \nontermdef{hexadecimal-escape-sequence}\br
|
1435 |
| - \terminal{\textbackslash x} simple-hexadecimal-digit-sequence\br |
1436 |
| - \terminal{\textbackslash x\{} simple-hexadecimal-digit-sequence \terminal{\}} |
| 1435 | + \literalterminal{\textbackslash x} simple-hexadecimal-digit-sequence\br |
| 1436 | + \literalterminal{\textbackslash x\{} simple-hexadecimal-digit-sequence \literalterminal{\}} |
1437 | 1437 | \end{bnf}
|
1438 | 1438 |
|
1439 | 1439 | \begin{bnf}
|
|
1621 | 1621 |
|
1622 | 1622 | \begin{bnf}
|
1623 | 1623 | \nontermdef{fractional-constant}\br
|
1624 |
| - \opt{digit-sequence} \terminal{.} digit-sequence\br |
1625 |
| - digit-sequence \terminal{.} |
| 1624 | + \opt{digit-sequence} \literalterminal{.} digit-sequence\br |
| 1625 | + digit-sequence \literalterminal{.} |
1626 | 1626 | \end{bnf}
|
1627 | 1627 |
|
1628 | 1628 | \begin{bnf}
|
1629 | 1629 | \nontermdef{hexadecimal-fractional-constant}\br
|
1630 |
| - \opt{hexadecimal-digit-sequence} \terminal{.} hexadecimal-digit-sequence\br |
1631 |
| - hexadecimal-digit-sequence \terminal{.} |
| 1630 | + \opt{hexadecimal-digit-sequence} \literalterminal{.} hexadecimal-digit-sequence\br |
| 1631 | + hexadecimal-digit-sequence \literalterminal{.} |
1632 | 1632 | \end{bnf}
|
1633 | 1633 |
|
1634 | 1634 | \begin{bnf}
|
1635 | 1635 | \nontermdef{exponent-part}\br
|
1636 |
| - \terminal{e} \opt{sign} digit-sequence\br |
1637 |
| - \terminal{E} \opt{sign} digit-sequence |
| 1636 | + \literalterminal{e} \opt{sign} digit-sequence\br |
| 1637 | + \literalterminal{E} \opt{sign} digit-sequence |
1638 | 1638 | \end{bnf}
|
1639 | 1639 |
|
1640 | 1640 | \begin{bnf}
|
1641 | 1641 | \nontermdef{binary-exponent-part}\br
|
1642 |
| - \terminal{p} \opt{sign} digit-sequence\br |
1643 |
| - \terminal{P} \opt{sign} digit-sequence |
| 1642 | + \literalterminal{p} \opt{sign} digit-sequence\br |
| 1643 | + \literalterminal{P} \opt{sign} digit-sequence |
1644 | 1644 | \end{bnf}
|
1645 | 1645 |
|
1646 | 1646 | \begin{bnf}
|
1647 | 1647 | \nontermdef{sign} \textnormal{one of}\br
|
1648 |
| - \terminal{+ -} |
| 1648 | + \literalterminal{+ -} |
1649 | 1649 | \end{bnf}
|
1650 | 1650 |
|
1651 | 1651 | \begin{bnf}
|
1652 | 1652 | \nontermdef{digit-sequence}\br
|
1653 | 1653 | digit\br
|
1654 |
| - digit-sequence \opt{\terminal{'}} digit |
| 1654 | + digit-sequence \opt{\literalterminal{'}} digit |
1655 | 1655 | \end{bnf}
|
1656 | 1656 |
|
1657 | 1657 | \begin{bnf}
|
1658 | 1658 | \nontermdef{floating-point-suffix} \textnormal{one of}\br
|
1659 |
| - \terminal{f l f16 f32 f64 f128 bf16 F L F16 F32 F64 F128 BF16} |
| 1659 | + \literalterminal{f l f16 f32 f64 f128 bf16 F L F16 F32 F64 F128 BF16} |
1660 | 1660 | \end{bnf}
|
1661 | 1661 |
|
1662 | 1662 | \pnum
|
|
1684 | 1684 | \topline
|
1685 | 1685 | \lhdr{\grammarterm{floating-point-suffix}} & \rhdr{type} \\ \capsep
|
1686 | 1686 | none & \keyword{double} \\
|
1687 |
| -\tcode{f} or \tcode{F} & \keyword {float} \\ |
1688 |
| -\tcode{l} or \tcode{L} & \keyword{long} \keyword{double} \\ |
1689 |
| -\tcode{f16} or \tcode{F16} & \tcode{std::float16_t} \\ |
1690 |
| -\tcode{f32} or \tcode{F32} & \tcode{std::float32_t} \\ |
1691 |
| -\tcode{f64} or \tcode{F64} & \tcode{std::float64_t} \\ |
1692 |
| -\tcode{f128} or \tcode{F128} & \tcode{std::float128_t} \\ |
1693 |
| -\tcode{bf16} or \tcode{BF16} & \tcode{std::bfloat16_t} \\ |
| 1687 | +\literaltcode{f} or \literaltcode{F} & \keyword {float} \\ |
| 1688 | +\literaltcode{l} or \literaltcode{L} & \keyword{long} \keyword{double} \\ |
| 1689 | +\literaltcode{f16} or \literaltcode{F16} & \literaltcode{std::float16_t} \\ |
| 1690 | +\literaltcode{f32} or \literaltcode{F32} & \literaltcode{std::float32_t} \\ |
| 1691 | +\literaltcode{f64} or \literaltcode{F64} & \literaltcode{std::float64_t} \\ |
| 1692 | +\literaltcode{f128} or \literaltcode{F128} & \literaltcode{std::float128_t} \\ |
| 1693 | +\literaltcode{bf16} or \literaltcode{BF16} & \literaltcode{std::bfloat16_t} \\ |
1694 | 1694 | \end{simpletypetable}
|
1695 | 1695 |
|
1696 | 1696 | \pnum
|
|
1741 | 1741 | \indextext{literal!string}%
|
1742 | 1742 | \begin{bnf}
|
1743 | 1743 | \nontermdef{string-literal}\br
|
1744 |
| - \opt{encoding-prefix} \terminal{"} \opt{s-char-sequence} \terminal{"}\br |
1745 |
| - \opt{encoding-prefix} \terminal{R} raw-string |
| 1744 | + \opt{encoding-prefix} \literalterminal{"} \opt{s-char-sequence} \literalterminal{"}\br |
| 1745 | + \opt{encoding-prefix} \literalterminal{R} raw-string |
1746 | 1746 | \end{bnf}
|
1747 | 1747 |
|
1748 | 1748 | \begin{bnf}
|
|
1766 | 1766 |
|
1767 | 1767 | \begin{bnf}
|
1768 | 1768 | \nontermdef{raw-string}\br
|
1769 |
| - \terminal{"} \opt{d-char-sequence} \terminal{(} \opt{r-char-sequence} \terminal{)} \opt{d-char-sequence} \terminal{"} |
| 1769 | + \literalterminal{"} \opt{d-char-sequence} \literalterminal{(} \opt{r-char-sequence} \literalterminal{)} \opt{d-char-sequence} \literalterminal{"} |
1770 | 1770 | \end{bnf}
|
1771 | 1771 |
|
1772 | 1772 | \begin{bnf}
|
|
1853 | 1853 |
|
1854 | 1854 | \pnum
|
1855 | 1855 | \indextext{literal!string!raw}%
|
1856 |
| -A \grammarterm{string-literal} that has an \tcode{R} |
| 1856 | +A \grammarterm{string-literal} that has an \literaltcode{R} |
1857 | 1857 | \indextext{prefix!\idxcode{R}}%
|
1858 | 1858 | in the prefix is a \defn{raw string literal}. The
|
1859 | 1859 | \grammarterm{d-char-sequence} serves as a delimiter. The terminating
|
|
0 commit comments