Skip to content

Commit 138abdd

Browse files
Merge pull request #270 from alercah/escape
Document the <=0x7F restriction on \x escapes.
2 parents 36fec1c + e93ed31 commit 138abdd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/tokens.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ literals. An escape starts with a `U+005C` (`\`) and continues with one of the
143143
following forms:
144144

145145
* An _8-bit code point escape_ starts with `U+0078` (`x`) and is
146-
followed by exactly two _hex digits_. It denotes the Unicode code point
147-
equal to the provided hex value.
146+
followed by exactly two _hex digits_ with value up to `0x7F`. It denotes the
147+
ASCII character with value equal to the provided hex value. Higher values are
148+
not permitted because it is ambiguous whether they mean Unicode code points or
149+
byte values.
148150
* A _24-bit code point escape_ starts with `U+0075` (`u`) and is followed
149151
by up to six _hex digits_ surrounded by braces `U+007B` (`{`) and `U+007D`
150152
(`}`). It denotes the Unicode code point equal to the provided hex value.
@@ -154,7 +156,7 @@ following forms:
154156
* The _null escape_ is the character `U+0030` (`0`) and denotes the Unicode
155157
value `U+0000` (NUL).
156158
* The _backslash escape_ is the character `U+005C` (`\`) which must be
157-
escaped in order to denote *itself*.
159+
escaped in order to denote itself.
158160

159161
#### Raw string literals
160162

0 commit comments

Comments
 (0)