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
Extract `IdentifierStartChar` from `IdentifierStart` and `RegExpIdentifierStart`.
Extract `IdentifierPartChar` from `IdentifierPart` and `RegExpIdentifierPart`.
This has 3 benefits:
- We eliminate some repetition between the productions for
Identifiers and RegExpIdentifiers.
- We can simplify 4 Early Error rules involving escape sequences,
because the constraint can now be expressed in terms of a single nonterminal,
rather than a nonterminal plus some terminals.
- We can eliminate the Early Error rule for `RegularExpressionFlags`
by instead expressing its constraint in the grammar:
in the production for `RegularExpressionFlags`,
replace `IdentifierPart` with `IdentifierPartChar`.
(As a consequence of the last point, this commit undefines the following id:
sec-literals-regular-expression-literals-static-semantics-early-errors
There didn't seem to be a sensible place to relocate it as an oldid.)
It is a Syntax Error if the SV of |UnicodeEscapeSequence| is none of *"$"*, or *"_"*, or ! UTF16EncodeCodePoint(_cp_) for some Unicode code point _cp_ matched by the |UnicodeIDStart| lexical grammar production.
16218
+
It is a Syntax Error if the SV of |UnicodeEscapeSequence| is not ! UTF16EncodeCodePoint(_cp_) for some Unicode code point _cp_ matched by the |IdentifierStartChar| lexical grammar production.
It is a Syntax Error if the SV of |UnicodeEscapeSequence| is none of *"$"*, *"_"*, ! UTF16EncodeCodePoint(<ZWNJ>), ! UTF16EncodeCodePoint(<ZWJ>), or ! UTF16EncodeCodePoint(_cp_) for some Unicode code point _cp_ that would be matched by the |UnicodeIDContinue| lexical grammar production.
16224
+
It is a Syntax Error if the SV of |UnicodeEscapeSequence| is not ! UTF16EncodeCodePoint(_cp_) for some Unicode code point _cp_ matched by the |IdentifierPartChar| lexical grammar production.
16219
16225
</li>
16220
16226
</ul>
16221
16227
</emu-clause>
@@ -17057,22 +17063,12 @@ <h2>Syntax</h2>
17057
17063
17058
17064
RegularExpressionFlags ::
17059
17065
[empty]
17060
-
RegularExpressionFlags IdentifierPart
17066
+
RegularExpressionFlags IdentifierPartChar
17061
17067
</emu-grammar>
17062
17068
<emu-note>
17063
17069
<p>Regular expression literals may not be empty; instead of representing an empty regular expression literal, the code unit sequence `//` starts a single-line comment. To specify an empty regular expression, use: `/(?:)/`.</p>
It is a Syntax Error if the CharacterValue of |RegExpUnicodeEscapeSequence| is not the code point value of *"$"*, *"_"*, or some code point matched by the |UnicodeIDStart| lexical grammar production.
34412
+
It is a Syntax Error if the CharacterValue of |RegExpUnicodeEscapeSequence| is not the code point value of some code point matched by the |IdentifierStartChar| lexical grammar production.
It is a Syntax Error if the CharacterValue of |RegExpUnicodeEscapeSequence| is not the code point value of *"$"*, *"_"*, <ZWNJ>, <ZWJ>, or some code point matched by the |UnicodeIDContinue| lexical grammar production.
34424
+
It is a Syntax Error if the CharacterValue of |RegExpUnicodeEscapeSequence| is not the code point value of some code point matched by the |IdentifierPartChar| lexical grammar production.
0 commit comments