SingleEscapeCharacter
DecimalDigit
x
u
HexEscapeSequence
::
x
HexDigit
HexDigit
UnicodeEscapeSequence
::
u
Hex4Digits
u{
CodePoint
}
Hex4Digits
::
HexDigit
HexDigit
HexDigit
HexDigit
The definition of the nonterminal
HexDigit
is given in
12.8.3
.
SourceCharacter
is defined in
11.1
.
NOTE 2
A string literal stands for a value of the String type. The String value (SV) of the literal is described in terms of String
values contributed by the various parts of the string literal. As part of this process, some Unicode code points within
the string literal are interpreted as having a
mathematical value
(MV), as described below or in
12.8.3
.
The SV of
StringLiteral
::
"
"
is the empty String.
The SV of
StringLiteral
::
'
'
is the empty String.
The SV of
DoubleStringCharacters
::
DoubleStringCharacter
DoubleStringCharacters
is the
string-concatenation
of the SV of
DoubleStringCharacter
and the SV of
DoubleStringCharacters
.
The SV of
SingleStringCharacters
::
SingleStringCharacter
SingleStringCharacters
is the
string-concatenation
of
the SV of
SingleStringCharacter
and the SV of
SingleStringCharacters
.
The SV of
DoubleStringCharacter
::
SourceCharacter
but not one of
"
or
\
or
LineTerminator
is the result of
performing
UTF16EncodeCodePoint
on the code point value of
SourceCharacter
.
The SV of
DoubleStringCharacter
::
<LS>
is the String value consisting of the code unit 0x2028 (LINE
SEPARATOR).
The SV of
DoubleStringCharacter
::
<PS>
is the String value consisting of the code unit 0x2029 (PARAGRAPH
SEPARATOR).
The SV of
DoubleStringCharacter
::
LineContinuation
is the empty String.
The SV of
SingleStringCharacter
::
SourceCharacter
but not one of
'
or
\
or
LineTerminator
is the result of
performing
UTF16EncodeCodePoint
on the code point value of
SourceCharacter
.
The SV of
SingleStringCharacter
::
<LS>
is the String value consisting of the code unit 0x2028 (LINE
SEPARATOR).
The SV of
SingleStringCharacter
::
<PS>
is the String value consisting of the code unit 0x2029 (PARAGRAPH
SEPARATOR).
The SV of
SingleStringCharacter
::
LineContinuation
is the empty String.
The SV of
EscapeSequence
::
0
is the String value consisting of the code unit 0x0000 (NULL).
<LF> and <CR> cannot appear in a string literal, except as part of a
LineContinuation
to produce
the empty code points sequence. The proper way to include either in the String value of a string
literal is to use an escape sequence such as
\n
\n
or
\u000A
\u000A
.
12.8.4.1 Static Semantics: SV
291