File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -819,7 +819,8 @@ considered _a single newline_.
819
819
### Disallowed Literal Code Points
820
820
821
821
The following code points may not appear literally anywhere in the document.
822
- They may be represented in Strings (but not Raw Strings) using [ Unicode Escapes] ( #escapes ) (` \u{...} ` ).
822
+ They may be represented in Strings (but not Raw Strings) using [ Unicode Escapes] ( #escapes ) (` \u{...} ` ,
823
+ except for non Unicode Scalar Value, which can't be represented even as escapes).
823
824
824
825
* The codepoints ` U+0000-0008 ` or the codepoints ` U+000E-001F ` (various
825
826
control characters).
@@ -876,9 +877,13 @@ disallowed-keyword-identifiers := 'true' | 'false' | 'null' | 'inf' | '-inf' | '
876
877
quoted-string := '"' single-line-string-body '"' | '"""' newline multi-line-string-body newline (unicode-space | ws-escape)* '"""'
877
878
single-line-string-body := (string-character - newline)*
878
879
multi-line-string-body := (('"' | '""')? string-character)*
879
- string-character := '\\' (["\\bfnrts] | 'u{' hex-digit{1, 6} '}') | ws-escape | [^\\"] - disallowed-literal-code-points
880
+ string-character := '\\' (["\\bfnrts] | 'u{' hex-unicode '}') | ws-escape | [^\\"] - disallowed-literal-code-points
880
881
ws-escape := '\\' (unicode-space | newline)+
881
882
hex-digit := [0-9a-fA-F]
883
+ hex-unicode := hex-digit{1, 6} - surrogates
884
+ surrogates := [dD][8-9a-fA-F]hex-digit{2}
885
+ // U+D800-DFFF: D 8 00
886
+ // D F FF
882
887
883
888
raw-string := '#' raw-string-quotes '#' | '#' raw-string '#'
884
889
raw-string-quotes := '"' single-line-raw-string-body '"' | '"""' newline multi-line-raw-string-body newline unicode-space* '"""'
You can’t perform that action at this time.
0 commit comments