You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
String Literals and String Interpolation says: "\x[0-9a-fA-F][0-9a-fA-F]? for an arbitrary 8-bit character specified by the given hexadecimal number" (and similar for octal).
This is incorrect and contradicts the "you can use the hexadecimal or octal notation to insert the UTF-8 byte sequences" later on the page. That is, the \x.. syntax species bytes making up the UTF-8 encoding of the (Unicode) character code, the \x.. construct does not specify a "8-bit character".
Nit: Also, in the same grammar definition: [^"\n\] is unclear (or at least abusing notation). The first backslash is presumably part of \n whereas the second backslash means a literal backslash. The Notation says "A newline character or CRLF sequence is written \n." which is fine in EBNF but is less suitable in a regexp character set [...] notation (e.g. can a lone CR appear as itself in a string-contents?).
On the other hand, in the same grammar definition, ... | \n | ... presumably does not mean a "newline character or CRLF sequence" but rather the two character sequence \n.
(Yes, I am of the opinion that grammars should be boringly formal. Not everyone agrees.)
The text was updated successfully, but these errors were encountered:
String Literals and String Interpolation says: "\x[0-9a-fA-F][0-9a-fA-F]? for an arbitrary 8-bit character specified by the given hexadecimal number" (and similar for octal).
This is incorrect and contradicts the "you can use the hexadecimal or octal notation to insert the UTF-8 byte sequences" later on the page. That is, the
\x..
syntax species bytes making up the UTF-8 encoding of the (Unicode) character code, the\x..
construct does not specify a "8-bit character".Also, the BNF grammar in the same section:
<string-contents> ::= ([^"\n\] | \[0-7][0-7?][0-7]? | \x[0-9a-fA-F][0-9a-fA-F]? | \n | \t | \" | \\)*
The
[0-7?]
should presumably be[0-7]?
.Nit: Also, in the same grammar definition:
[^"\n\]
is unclear (or at least abusing notation). The first backslash is presumably part of\n
whereas the second backslash means a literal backslash. The Notation says "A newline character or CRLF sequence is written \n." which is fine in EBNF but is less suitable in a regexp character set[...]
notation (e.g. can a lone CR appear as itself in astring-contents
?).On the other hand, in the same grammar definition,
... | \n | ...
presumably does not mean a "newline character or CRLF sequence" but rather the two character sequence\
n
.(Yes, I am of the opinion that grammars should be boringly formal. Not everyone agrees.)
The text was updated successfully, but these errors were encountered: