@@ -250,8 +250,7 @@ cases mentioned in [Number literals](#number-literals) below.
250
250
##### Unicode escapes
251
251
| | Name |
252
252
| ---| ------|
253
- | ` \u7FFF ` | 16-bit character code (exactly 4 digits) |
254
- | ` \U7EEEFFFF ` | 32-bit character code (exactly 8 digits) |
253
+ | ` \u{7FFF} ` | 24-bit Unicode character code (up to 6 digits) |
255
254
256
255
##### Numbers
257
256
@@ -286,8 +285,8 @@ raw_string : '"' raw_string_body '"' | '#' raw_string '#' ;
286
285
common_escape : '\x5c'
287
286
| 'n' | 'r' | 't' | '0'
288
287
| 'x' hex_digit 2
289
- unicode_escape : 'u' hex_digit 4
290
- | 'U ' hex_digit 8 ;
288
+
289
+ unicode_escape : 'u' '{ ' hex_digit+ 6 '}' ;
291
290
292
291
hex_digit : 'a' | 'b' | 'c' | 'd' | 'e' | 'f'
293
292
| 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
@@ -320,12 +319,9 @@ following forms:
320
319
* An _ 8-bit codepoint escape_ escape starts with ` U+0078 ` (` x ` ) and is
321
320
followed by exactly two _ hex digits_ . It denotes the Unicode codepoint
322
321
equal to the provided hex value.
323
- * A _ 16-bit codepoint escape_ starts with ` U+0075 ` (` u ` ) and is followed
324
- by exactly four _ hex digits_ . It denotes the Unicode codepoint equal to
325
- the provided hex value.
326
- * A _ 32-bit codepoint escape_ starts with ` U+0055 ` (` U ` ) and is followed
327
- by exactly eight _ hex digits_ . It denotes the Unicode codepoint equal to
328
- the provided hex value.
322
+ * A _ 24-bit codepoint escape_ starts with ` U+0075 ` (` u ` ) and is followed
323
+ by up to six _ hex digits_ surrounded by braces ` U+007B ` (` { ` ) and ` U+007D `
324
+ (` } ` ). It denotes the Unicode codepoint equal to the provided hex value.
329
325
* A _ whitespace escape_ is one of the characters ` U+006E ` (` n ` ), ` U+0072 `
330
326
(` r ` ), or ` U+0074 ` (` t ` ), denoting the unicode values ` U+000A ` (LF),
331
327
` U+000D ` (CR) or ` U+0009 ` (HT) respectively.
0 commit comments