diff --git a/spec.html b/spec.html index 96e8e933edc..61b34113be3 100644 --- a/spec.html +++ b/spec.html @@ -24500,7 +24500,7 @@

Forbidden Extensions

The behaviour of built-in methods which are specified in ECMA-402, such as those named `toLocaleString`, must not be extended except as specified in ECMA-402.
  • - The RegExp pattern grammars in and must not be extended to recognize any of the source characters A-Z or a-z as |IdentityEscape[+U]| when the [U] grammar parameter is present. + The RegExp pattern grammars in must not be extended to recognize any of the source characters A-Z or a-z as |IdentityEscape[+U]| when the [U] grammar parameter is present.
  • The Syntactic Grammar must not be extended in any manner that allows the token `:` to immediately follow source text that matches the |BindingIdentifier| nonterminal symbol. @@ -30289,6 +30289,7 @@

    RegExp (Regular Expression) Objects

    Syntax for Patterns

    The `RegExp` constructor applies the following grammar to the input pattern String. An error occurs if the grammar cannot interpret the String as an expansion of |Pattern|.

    +

    Some of these productions (indicated by “::!”) introduce ambiguities that are broken by the ordering of alternatives. When parsing using such productions, each alternative is considered only if previous alternatives do not match.

    Patterns

    Pattern[U, N] :: @@ -30302,21 +30303,30 @@

    Patterns

    [empty] Alternative[?U, ?N] Term[?U, ?N] - Term[U, N] :: - Assertion[?U, ?N] - Atom[?U, ?N] - Atom[?U, ?N] Quantifier + Term[U, N] ::! + [+U] Assertion[+U, ?N] + [+U] Atom[+U, ?N] + [+U] Atom[+U, ?N] Quantifier + [~U] QuantifiableAssertion[?N] Quantifier + [~U] Assertion[~U, ?N] + [~U] ExtendedAtom[?N] Quantifier + [~U] ExtendedAtom[?N] Assertion[U, N] :: `^` `$` `\` `b` `\` `B` - `(` `?` `=` Disjunction[?U, ?N] `)` - `(` `?` `!` Disjunction[?U, ?N] `)` + [+U] `(` `?` `=` Disjunction[+U, ?N] `)` + [+U] `(` `?` `!` Disjunction[+U, ?N] `)` + [~U] QuantifiableAssertion[?N] `(` `?` `<=` Disjunction[?U, ?N] `)` `(` `?` `<!` Disjunction[?U, ?N] `)` + QuantifiableAssertion[N] :: + `(` `?` `=` Disjunction[~U, ?N] `)` + `(` `?` `!` Disjunction[~U, ?N] `)` + Quantifier :: QuantifierPrefix QuantifierPrefix `?` @@ -30329,6 +30339,16 @@

    Patterns

    `{` DecimalDigits[~Sep] `,` `}` `{` DecimalDigits[~Sep] `,` DecimalDigits[~Sep] `}` + ExtendedAtom[N] ::! + `.` + `\` AtomEscape[~U, ?N] + `\` [lookahead == `c`] + CharacterClass[~U] + `(` Disjunction[~U, ?N] `)` + `(` `?` `:` Disjunction[~U, ?N] `)` + InvalidBracedQuantifier + ExtendedPatternCharacter + Atom[U, N] :: PatternCharacter `.` @@ -30337,6 +30357,14 @@

    Patterns

    `(` GroupSpecifier[?U] Disjunction[?U, ?N] `)` `(` `?` `:` Disjunction[?U, ?N] `)` + InvalidBracedQuantifier :: + `{` DecimalDigits `}` + `{` DecimalDigits `,` `}` + `{` DecimalDigits `,` DecimalDigits `}` + + ExtendedPatternCharacter :: + SourceCharacter but not one of `^` `$` `\` `.` `*` `+` `?` `(` `)` `[` `|` + PatternCharacter :: SourceCharacter but not SyntaxCharacter @@ -30404,23 +30432,30 @@

    Character Classes

    `-` ClassAtomNoDash[?U] - ClassAtomNoDash[U] :: + ClassAtomNoDash[U, N] ::! SourceCharacter but not one of `\` or `]` or `-` - `\` ClassEscape[?U] + `\` ClassEscape[?U, ?N] + `\` [lookahead == `c`]

    Escapes

    - ClassEscape[U] :: + ClassEscape[U, N] ::! `b` [+U] `-` + [~U] `c` ClassControlLetter CharacterClassEscape[?U] - CharacterEscape[?U] + CharacterEscape[?U, ?N] - AtomEscape[U, N] :: - DecimalEscape + ClassControlLetter :: + DecimalDigit + `_` + + AtomEscape[U, N] ::! + [+U] DecimalEscape + [~U] DecimalEscape [> but only if the CapturingGroupNumber of |DecimalEscape| is <= _NcapturingParens_] CharacterClassEscape[?U] - CharacterEscape[?U] + CharacterEscape[~U, ?N] [+N] `k` GroupName[?U] DecimalEscape :: @@ -30463,13 +30498,14 @@

    Escapes

    ControlLetter `_` - CharacterEscape[U] :: + CharacterEscape[U, N] ::! ControlEscape `c` ControlLetter `0` [lookahead <! DecimalDigit] HexEscapeSequence RegExpUnicodeEscapeSequence[?U] - IdentityEscape[?U] + [~U] LegacyOctalEscapeSequence + IdentityEscape[?U, ?N] ControlEscape :: one of `f` `n` `r` `t` `v` @@ -30497,21 +30533,36 @@

    Escapes

    HexNonSurrogate :: Hex4Digits [> but only if the MV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] - IdentityEscape[U] :: + IdentityEscape[U, N] :: [+U] SyntaxCharacter [+U] `/` - [~U] SourceCharacter but not UnicodeIDContinue + [~U] SourceCharacterIdentityEscape[?N] + + SourceCharacterIdentityEscape[N] :: + [~N] SourceCharacter but not `c` + [+N] SourceCharacter but not one of `c` or `k` +
    + +

    Patterns that use the following productions are allowed, but deprecated:

    + + Term :: QuantifiableAssertion Quantifier + + Atom :: `\` [lookahead == `c`] + + ClassAtomNoDash :: `\` [lookahead == `c`] + + ClassEscape :: `c` ClassControlLetter + + CharacterEscape :: LegacyOctalEscapeSequence + +

    Static Semantics for Patterns

    - -

    A number of productions in this section are given alternative definitions in section .

    -
    - - +

    Static Semantics: Early Errors

    This section is amended in .

    @@ -30531,6 +30582,12 @@

    Static Semantics: Early Errors

    It is a Syntax Error if the MV of the first |DecimalDigits| is larger than the MV of the second |DecimalDigits|.
  • + ExtendedAtom :: InvalidBracedQuantifier + RegExpIdentifierStart[U] :: `\` RegExpUnicodeEscapeSequence[+U]