Restrictioncore-escape-unicode
In \u{}, is a sequence of four, five or six hexadecimal digits whose value is a Unicode scalar value, that is, at most 10FFFF and outside the surrogate range D800 to DFFF. No other sequence beginning with \ is an escape sequence.
Tests (5)
- elm / AstralCharLiteralTestA `Char` literal above U+FFFF has its full code point: `'\u{1F600}'` is 128512, and is the same character as `'馃榾'` written directly.
- elm / CharLiteralSurrogateEscapeTest`'\u{D800}'` is not a Char literal: a surrogate code point is not a character.
- elm / ParseErrorStringEscapeTooFewDigitsTestA Unicode escape in a string with only two hex digits, `"\u{41}"`, is rejected with a BAD UNICODE ESCAPE syntax error.
- elm / ParseErrorStringEscapeUnclosedTestA Unicode escape in a string with no closing brace, `"\u{12"`, is rejected with a BAD UNICODE ESCAPE syntax error.
- elm / StandardA8SurrogateEscapeTest`\u{D800}` is not an escape sequence: a surrogate code point is not a character.
Discussions
Discuss this restriction路Search the discussions on GitHub
Discussions are on GitHub; one about this restriction has [res:core-escape-unicode] in its title.
A Standard Definition of Elm? (Draft version 0.4) 漏 Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.