@@ -320,9 +320,9 @@ b"\\x52"; br"\x52"; // \x52
320
320
> ** <sup >Lexer</sup >** \
321
321
> C_STRING_LITERAL :\
322
322
>   ;  ; ` c" ` (\
323
- >   ;  ;   ;  ; ~ \[ ` " ` ` \ ` _ IsolatedCR_ ] \
324
- >   ;  ;   ;  ; | BYTE_ESCAPE\
325
- >   ;  ;   ;  ; | UNICODE_ESCAPE\
323
+ >   ;  ;   ;  ; ~ \[ ` " ` ` \ ` _ IsolatedCR_ _ NUL _ ] \
324
+ >   ;  ;   ;  ; | BYTE_ESCAPE _ except ` \0 ` or ` \x00 ` _ \
325
+ >   ;  ;   ;  ; | UNICODE_ESCAPE _ except ` \u{0} ` , ` \u{00} ` , …, ` \u{000000} ` _ \
326
326
>   ;  ;   ;  ; | STRING_CONTINUE\
327
327
>   ;  ; )<sup >\* </sup > ` " ` SUFFIX<sup >?</sup >
328
328
@@ -355,10 +355,6 @@ starts with a `U+005C` (`\`) and continues with one of the following forms:
355
355
* The _ backslash escape_ is the character ` U+005C ` (` \ ` ) which must be
356
356
escaped in order to denote its ASCII encoding ` 0x5C ` .
357
357
358
- The escape sequences ` \0 ` , ` \x00 ` , and ` \u{0000} ` are permitted within the token
359
- but will be rejected as invalid, as C strings may not contain byte ` 0x00 ` except
360
- as the implicit terminator.
361
-
362
358
A C string represents bytes with no defined encoding, but a C string literal
363
359
may contain Unicode characters above ` U+007F ` . Such characters will be replaced
364
360
with the bytes of that character's UTF-8 representation.
@@ -381,16 +377,16 @@ c"\xC3\xA6";
381
377
>   ;  ; ` cr ` RAW_C_STRING_CONTENT SUFFIX<sup >?</sup >
382
378
>
383
379
> RAW_C_STRING_CONTENT :\
384
- >   ;  ;   ;  ; ` " ` ( ~ _ IsolatedCR_ )<sup >* (non-greedy)</sup > ` " ` \
380
+ >   ;  ;   ;  ; ` " ` ( ~ _ IsolatedCR_ _ NUL _ )<sup >* (non-greedy)</sup > ` " ` \
385
381
>   ;  ; | ` # ` RAW_C_STRING_CONTENT ` # `
386
382
387
383
Raw C string literals do not process any escapes. They start with the
388
384
character ` U+0063 ` (` c ` ), followed by ` U+0072 ` (` r ` ), followed by fewer than 256
389
385
of the character ` U+0023 ` (` # ` ), and a ` U+0022 ` (double-quote) character. The
390
- _ raw C string body_ can contain any sequence of Unicode characters and is
391
- terminated only by another ` U+0022 ` (double-quote) character, followed by the
392
- same number of ` U+0023 ` (` # ` ) characters that preceded the opening ` U+0022 `
393
- (double-quote) character.
386
+ _ raw C string body_ can contain any sequence of Unicode characters (other than
387
+ ` U+0000 ` ) and is terminated only by another ` U+0022 ` (double-quote) character,
388
+ followed by the same number of ` U+0023 ` (` # ` ) characters that preceded the
389
+ opening ` U+0022 ` (double-quote) character.
394
390
395
391
All characters contained in the raw C string body represent themselves in UTF-8
396
392
encoding. The characters ` U+0022 ` (double-quote) (except when followed by at
0 commit comments