- tmp/tmp4mkv6h0u/{from.md → to.md} +130 -122
tmp/tmp4mkv6h0u/{from.md → to.md}
RENAMED
|
@@ -16,153 +16,161 @@ c-char-sequence:
|
|
| 16 |
c-char-sequence c-char
|
| 17 |
```
|
| 18 |
|
| 19 |
``` bnf
|
| 20 |
c-char:
|
| 21 |
-
|
| 22 |
escape-sequence
|
| 23 |
universal-character-name
|
| 24 |
```
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
``` bnf
|
| 27 |
escape-sequence:
|
| 28 |
simple-escape-sequence
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
octal-escape-sequence
|
| 30 |
hexadecimal-escape-sequence
|
| 31 |
```
|
| 32 |
|
| 33 |
``` bnf
|
| 34 |
-
simple-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
```
|
| 38 |
|
| 39 |
``` bnf
|
| 40 |
octal-escape-sequence:
|
| 41 |
'\' octal-digit
|
| 42 |
'\' octal-digit octal-digit
|
| 43 |
'\' octal-digit octal-digit octal-digit
|
|
|
|
| 44 |
```
|
| 45 |
|
| 46 |
``` bnf
|
| 47 |
hexadecimal-escape-sequence:
|
| 48 |
-
'\x' hexadecimal-digit
|
| 49 |
-
hexadecimal-
|
| 50 |
```
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
character
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
*
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
*c-char*
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
character literal
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
*
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
[*Note 4*: If the value of a *character-literal* prefixed by `u`, `u8`,
|
| 154 |
-
or `U` is outside the range defined for its type, the program is
|
| 155 |
-
ill-formed. — *end note*]
|
| 156 |
-
|
| 157 |
-
A *universal-character-name* is translated to the encoding, in the
|
| 158 |
-
appropriate execution character set, of the character named. If there is
|
| 159 |
-
no such encoding, the *universal-character-name* is translated to an
|
| 160 |
-
*implementation-defined* encoding.
|
| 161 |
-
|
| 162 |
-
[*Note 5*: In translation phase 1, a *universal-character-name* is
|
| 163 |
-
introduced whenever an actual extended character is encountered in the
|
| 164 |
-
source text. Therefore, all extended characters are described in terms
|
| 165 |
-
of *universal-character-name*s. However, the actual compiler
|
| 166 |
-
implementation may use its own native character set, so long as the same
|
| 167 |
-
results are obtained. — *end note*]
|
| 168 |
|
|
|
|
| 16 |
c-char-sequence c-char
|
| 17 |
```
|
| 18 |
|
| 19 |
``` bnf
|
| 20 |
c-char:
|
| 21 |
+
basic-c-char
|
| 22 |
escape-sequence
|
| 23 |
universal-character-name
|
| 24 |
```
|
| 25 |
|
| 26 |
+
``` bnf
|
| 27 |
+
basic-c-char:
|
| 28 |
+
any member of the translation character set except the U+0027 (apostrophe),
|
| 29 |
+
U+005c (reverse solidus), or new-line character
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
``` bnf
|
| 33 |
escape-sequence:
|
| 34 |
simple-escape-sequence
|
| 35 |
+
numeric-escape-sequence
|
| 36 |
+
conditional-escape-sequence
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
``` bnf
|
| 40 |
+
simple-escape-sequence:
|
| 41 |
+
'\' simple-escape-sequence-char
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
``` bnf
|
| 45 |
+
simple-escape-sequence-char: one of
|
| 46 |
+
'' " ? \ a b f n r t v'
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
``` bnf
|
| 50 |
+
numeric-escape-sequence:
|
| 51 |
octal-escape-sequence
|
| 52 |
hexadecimal-escape-sequence
|
| 53 |
```
|
| 54 |
|
| 55 |
``` bnf
|
| 56 |
+
simple-octal-digit-sequence:
|
| 57 |
+
octal-digit
|
| 58 |
+
simple-octal-digit-sequence octal-digit
|
| 59 |
```
|
| 60 |
|
| 61 |
``` bnf
|
| 62 |
octal-escape-sequence:
|
| 63 |
'\' octal-digit
|
| 64 |
'\' octal-digit octal-digit
|
| 65 |
'\' octal-digit octal-digit octal-digit
|
| 66 |
+
'\o{' simple-octal-digit-sequence '}'
|
| 67 |
```
|
| 68 |
|
| 69 |
``` bnf
|
| 70 |
hexadecimal-escape-sequence:
|
| 71 |
+
'\x' simple-hexadecimal-digit-sequence
|
| 72 |
+
'\x{' simple-hexadecimal-digit-sequence '}'
|
| 73 |
```
|
| 74 |
|
| 75 |
+
``` bnf
|
| 76 |
+
conditional-escape-sequence:
|
| 77 |
+
'\' conditional-escape-sequence-char
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
``` bnf
|
| 81 |
+
conditional-escape-sequence-char:
|
| 82 |
+
any member of the basic character set that is not an octal-digit, a simple-escape-sequence-char, or the characters 'N', 'o', 'u', 'U', or 'x'
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
A *non-encodable character literal* is a *character-literal* whose
|
| 86 |
+
*c-char-sequence* consists of a single *c-char* that is not a
|
| 87 |
+
*numeric-escape-sequence* and that specifies a character that either
|
| 88 |
+
lacks representation in the literal’s associated character encoding or
|
| 89 |
+
that cannot be encoded as a single code unit. A *multicharacter literal*
|
| 90 |
+
is a *character-literal* whose *c-char-sequence* consists of more than
|
| 91 |
+
one *c-char*. The *encoding-prefix* of a non-encodable character literal
|
| 92 |
+
or a multicharacter literal shall be absent. Such *character-literal*s
|
| 93 |
+
are conditionally-supported.
|
| 94 |
+
|
| 95 |
+
The kind of a *character-literal*, its type, and its associated
|
| 96 |
+
character encoding [[lex.charset]] are determined by its
|
| 97 |
+
*encoding-prefix* and its *c-char-sequence* as defined by
|
| 98 |
+
[[lex.ccon.literal]]. The special cases for non-encodable character
|
| 99 |
+
literals and multicharacter literals take precedence over the base kind.
|
| 100 |
+
|
| 101 |
+
[*Note 1*: The associated character encoding for ordinary character
|
| 102 |
+
literals determines encodability, but does not determine the value of
|
| 103 |
+
non-encodable ordinary character literals or ordinary multicharacter
|
| 104 |
+
literals. The examples in [[lex.ccon.literal]] for non-encodable
|
| 105 |
+
ordinary character literals assume that the specified character lacks
|
| 106 |
+
representation in the ordinary literal encoding or that encoding the
|
| 107 |
+
character would require more than one code unit. — *end note*]
|
| 108 |
+
|
| 109 |
+
**Table: Character literals** <a id="lex.ccon.literal">[lex.ccon.literal]</a>
|
| 110 |
+
|
| 111 |
+
| | | | | |
|
| 112 |
+
| ---- | -------------------------- | ---------- | ------------ | ------- |
|
| 113 |
+
| none | ordinary character literal | `char` | ordinary | `'v'` |
|
| 114 |
+
| `L` | wide character literal | `wchar_t` | wide literal | `L'w'` |
|
| 115 |
+
| | | | encoding | |
|
| 116 |
+
| `u8` | UTF-8 character literal | `char8_t` | UTF-8 | `u8'x'` |
|
| 117 |
+
| `u` | UTF-16 character literal | `char16_t` | UTF-16 | `u'y'` |
|
| 118 |
+
| `U` | UTF-32 character literal | `char32_t` | UTF-32 | `U'z'` |
|
| 119 |
+
|
| 120 |
+
|
| 121 |
+
In translation phase 4, the value of a *character-literal* is determined
|
| 122 |
+
using the range of representable values of the *character-literal*’s
|
| 123 |
+
type in translation phase 7. A non-encodable character literal or a
|
| 124 |
+
multicharacter literal has an *implementation-defined* value. The value
|
| 125 |
+
of any other kind of *character-literal* is determined as follows:
|
| 126 |
+
|
| 127 |
+
- A *character-literal* with a *c-char-sequence* consisting of a single
|
| 128 |
+
*basic-c-char*, *simple-escape-sequence*, or
|
| 129 |
+
*universal-character-name* is the code unit value of the specified
|
| 130 |
+
character as encoded in the literal’s associated character encoding.
|
| 131 |
+
\[*Note 2*: If the specified character lacks representation in the
|
| 132 |
+
literal’s associated character encoding or if it cannot be encoded as
|
| 133 |
+
a single code unit, then the literal is a non-encodable character
|
| 134 |
+
literal. — *end note*]
|
| 135 |
+
- A *character-literal* with a *c-char-sequence* consisting of a single
|
| 136 |
+
*numeric-escape-sequence* has a value as follows:
|
| 137 |
+
- Let v be the integer value represented by the octal number
|
| 138 |
+
comprising the sequence of *octal-digit*s in an
|
| 139 |
+
*octal-escape-sequence* or by the hexadecimal number comprising the
|
| 140 |
+
sequence of *hexadecimal-digit*s in a *hexadecimal-escape-sequence*.
|
| 141 |
+
- If v does not exceed the range of representable values of the
|
| 142 |
+
*character-literal*’s type, then the value is v.
|
| 143 |
+
- Otherwise, if the *character-literal*’s *encoding-prefix* is absent
|
| 144 |
+
or `L`, and v does not exceed the range of representable values of
|
| 145 |
+
the corresponding unsigned type for the underlying type of the
|
| 146 |
+
*character-literal*’s type, then the value is the unique value of
|
| 147 |
+
the *character-literal*’s type `T` that is congruent to v modulo 2ᴺ,
|
| 148 |
+
where N is the width of `T`.
|
| 149 |
+
- Otherwise, the *character-literal* is ill-formed.
|
| 150 |
+
- A *character-literal* with a *c-char-sequence* consisting of a single
|
| 151 |
+
*conditional-escape-sequence* is conditionally-supported and has an
|
| 152 |
+
*implementation-defined* value.
|
| 153 |
+
|
| 154 |
+
The character specified by a *simple-escape-sequence* is specified in
|
| 155 |
+
[[lex.ccon.esc]].
|
| 156 |
+
|
| 157 |
+
[*Note 3*: Using an escape sequence for a question mark is supported
|
| 158 |
+
for compatibility with ISO C++14 and ISO C. — *end note*]
|
| 159 |
+
|
| 160 |
+
**Table: Simple escape sequences** <a id="lex.ccon.esc">[lex.ccon.esc]</a>
|
| 161 |
+
|
| 162 |
+
| character | | *simple-escape-sequence* |
|
| 163 |
+
| --------- | -------------------- | ------------------------ |
|
| 164 |
+
| `U+000a` | line feed | `\n` |
|
| 165 |
+
| `U+0009` | character tabulation | `\t` |
|
| 166 |
+
| `U+000b` | line tabulation | `\v` |
|
| 167 |
+
| `U+0008` | backspace | `\b` |
|
| 168 |
+
| `U+000d` | carriage return | `\r` |
|
| 169 |
+
| `U+000c` | form feed | `\f` |
|
| 170 |
+
| `U+0007` | alert | `\a` |
|
| 171 |
+
| `U+005c` | reverse solidus | `` |
|
| 172 |
+
| `U+003f` | question mark | `\?` |
|
| 173 |
+
| `U+0027` | apostrophe | `\'` |
|
| 174 |
+
| `U+0022` | quotation mark | `\"` |
|
| 175 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
|