Skip to content

Commit 30cce45

Browse files
authored
Merge pull request #7228 from dotnet/merges/master-to-release/dev16.3
Merge master to release/dev16.3
2 parents 1ad5657 + 7780cab commit 30cce45

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/fsharp/lexhelp.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ type lexargs =
6060
applyLineDirectives: bool
6161
pathMap: PathMap }
6262

63-
/// possible results of lexing a long unicode escape sequence in a string literal, e.g. "\UDEADBEEF"
63+
/// possible results of lexing a long Unicode escape sequence in a string literal, e.g. "\U0001F47D",
64+
/// "\U000000E7", or "\UDEADBEEF" returning SurrogatePair, SingleChar, or Invalid, respectively
6465
type LongUnicodeLexResult =
6566
| SurrogatePair of uint16 * uint16
6667
| SingleChar of uint16
@@ -169,7 +170,9 @@ let unicodeGraphLong (s:string) =
169170
if high = 0 then SingleChar(uint16 low)
170171
// invalid encoding
171172
elif high > 0x10 then Invalid
172-
// valid surrogate pair - see http://www.unicode.org/unicode/uni2book/ch03.pdf, section 3.7 *)
173+
// valid supplementary character: code points U+10000 to U+10FFFF
174+
// valid surrogate pair: see http://www.unicode.org/versions/latest/ch03.pdf , "Surrogates" section
175+
// high-surrogate code point (U+D800 to U+DBFF) followed by low-surrogate code point (U+DC00 to U+DFFF)
173176
else
174177
let codepoint = high * 0x10000 + low
175178
let hiSurr = uint16 (0xD800 + ((codepoint - 0x10000) / 0x400))

0 commit comments

Comments
 (0)