@@ -53,20 +53,21 @@ SourceCharacter ::
53
53
- "U+0020–U+FFFF"
54
54
55
55
GraphQL documents are expressed as a sequence of
56
- [ Unicode] ( https://unicode.org/standard/standard.html ) characters. However, with
56
+ [ Unicode] ( https://unicode.org/standard/standard.html ) code points (informally
57
+ referred to as * "characters"* through most of this specification). However, with
57
58
few exceptions, most of GraphQL is expressed only in the original non-control
58
59
ASCII range so as to be as widely compatible with as many existing tools,
59
60
languages, and serialization formats as possible and avoid display issues in
60
61
text editors and source control.
61
62
63
+ Note: Non-ASCII Unicode characters may appear freely within {StringValue} and
64
+ {Comment} portions of GraphQL.
65
+
62
66
63
67
### Unicode
64
68
65
69
UnicodeBOM :: "Byte Order Mark (U+FEFF)"
66
70
67
- Non-ASCII Unicode characters may freely appear within {StringValue} and
68
- {Comment} portions of GraphQL.
69
-
70
71
The "Byte Order Mark" is a special Unicode character which
71
72
may appear at the beginning of a file containing Unicode which programs may use
72
73
to determine the fact that the text stream is Unicode, what endianness the text
@@ -804,13 +805,13 @@ StringValue ::
804
805
- ` """ ` BlockStringCharacter* ` """ `
805
806
806
807
StringCharacter ::
807
- - SourceCharacter but not ` " ` or \ or LineTerminator
808
- - \u EscapedUnicode
809
- - \ EscapedCharacter
808
+ - SourceCharacter but not ` " ` or ` \ ` or LineTerminator
809
+ - ` \u ` EscapedUnicode
810
+ - ` \ ` EscapedCharacter
810
811
811
812
EscapedUnicode :: /[ 0-9A-Fa-f] {4}/
812
813
813
- EscapedCharacter :: one of ` " ` \ ` / ` b f n r t
814
+ EscapedCharacter :: one of ` " ` ` \ ` ` / ` ` b ` ` f ` ` n ` ` r ` ` t `
814
815
815
816
BlockStringCharacter ::
816
817
- SourceCharacter but not ` """ ` or ` \""" `
@@ -825,9 +826,9 @@ be interpreted as the beginning of a block string. As an example, the source
825
826
{` """""" ` } can only be interpreted as a single empty block string and not three
826
827
empty strings.
827
828
828
- Non-ASCII Unicode characters are allowed within single-quoted strings.
829
- Since {SourceCharacter} must not contain some ASCII control characters, escape
830
- sequences must be used to represent these characters. The {` \ ` }, {` " ` }
829
+ Non-ASCII Unicode characters are allowed within single-quoted strings.
830
+ Since {SourceCharacter} must not contain some ASCII control characters, escape
831
+ sequences must be used to represent these characters. The {` \ ` }, {` " ` }
831
832
characters also must be escaped. All other escape sequences are optional.
832
833
833
834
** Block Strings**
@@ -892,32 +893,33 @@ StringValue :: `""`
892
893
893
894
StringValue :: ` " ` StringCharacter+ ` " `
894
895
895
- * Return the Unicode character sequence of all {StringCharacter}
896
- Unicode character values.
896
+ * Return the sequence of all {StringCharacter} code points.
897
897
898
- StringCharacter :: SourceCharacter but not ` " ` or \ or LineTerminator
898
+ StringCharacter :: SourceCharacter but not ` " ` or ` \ ` or LineTerminator
899
899
900
- * Return the character value of {SourceCharacter}.
900
+ * Return the code point {SourceCharacter}.
901
901
902
- StringCharacter :: \u EscapedUnicode
902
+ StringCharacter :: ` \u ` EscapedUnicode
903
903
904
- * Return the character whose code unit value in the Unicode Basic Multilingual
905
- Plane is the 16-bit hexadecimal value {EscapedUnicode}.
904
+ * Let {value} be the 16-bit hexadecimal value represented by the sequence of
905
+ {HexDigit} within {EscapedUnicode}.
906
+ * Return the code point {value}.
906
907
907
- StringCharacter :: \ EscapedCharacter
908
+ StringCharacter :: ` \ ` EscapedCharacter
908
909
909
- * Return the character value of {EscapedCharacter} according to the table below.
910
+ * Return the code point represented by {EscapedCharacter} according to the
911
+ table below.
910
912
911
- | Escaped Character | Code Unit Value | Character Name |
912
- | ----------------- | --------------- | ---------------------------- |
913
- | ` " ` | U+0022 | double quote |
914
- | ` \ ` | U+005C | reverse solidus (back slash) |
915
- | ` / ` | U+002F | solidus (forward slash) |
916
- | ` b ` | U+0008 | backspace |
917
- | ` f ` | U+000C | form feed |
918
- | ` n ` | U+000A | line feed (new line) |
919
- | ` r ` | U+000D | carriage return |
920
- | ` t ` | U+0009 | horizontal tab |
913
+ | Escaped Character | Code Point | Character Name |
914
+ | ----------------- | ---------- | ---------------------------- |
915
+ | { ` " ` } | U+0022 | double quote |
916
+ | { ` \ ` } | U+005C | reverse solidus (back slash) |
917
+ | { ` / ` } | U+002F | solidus (forward slash) |
918
+ | { ` b ` } | U+0008 | backspace |
919
+ | { ` f ` } | U+000C | form feed |
920
+ | { ` n ` } | U+000A | line feed (new line) |
921
+ | { ` r ` } | U+000D | carriage return |
922
+ | { ` t ` } | U+0009 | horizontal tab |
921
923
922
924
StringValue :: ` """ ` BlockStringCharacter* ` """ `
923
925
0 commit comments