From 0739d67425ae9aa00a3c9b33ca05af29c407ced8 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Thu, 20 May 2021 18:39:04 +0200 Subject: [PATCH] =?UTF-8?q?Editorial:=20Clarify=20RegExp=20grammar=20param?= =?UTF-8?q?eter=20U=20=E2=86=92=20UnicodeFlag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the parameter more easily searchable while clarifying its meaning. --- spec.html | 228 +++++++++++++++++++++++++++--------------------------- 1 file changed, 114 insertions(+), 114 deletions(-) diff --git a/spec.html b/spec.html index 9f9d9ccc20c..663cacd9b53 100644 --- a/spec.html +++ b/spec.html @@ -24453,7 +24453,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 and must not be extended to recognize any of the source characters A-Z or a-z as |IdentityEscape[+UnicodeFlag]| when the [UnicodeFlag] 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. @@ -30246,31 +30246,31 @@

    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|.

    Syntax

    - Pattern[U, N] :: - Disjunction[?U, ?N] + Pattern[UnicodeFlag, N] :: + Disjunction[?UnicodeFlag, ?N] - Disjunction[U, N] :: - Alternative[?U, ?N] - Alternative[?U, ?N] `|` Disjunction[?U, ?N] + Disjunction[UnicodeFlag, N] :: + Alternative[?UnicodeFlag, ?N] + Alternative[?UnicodeFlag, ?N] `|` Disjunction[?UnicodeFlag, ?N] - Alternative[U, N] :: + Alternative[UnicodeFlag, N] :: [empty] - Alternative[?U, ?N] Term[?U, ?N] + Alternative[?UnicodeFlag, ?N] Term[?UnicodeFlag, ?N] - Term[U, N] :: - Assertion[?U, ?N] - Atom[?U, ?N] - Atom[?U, ?N] Quantifier + Term[UnicodeFlag, N] :: + Assertion[?UnicodeFlag, ?N] + Atom[?UnicodeFlag, ?N] + Atom[?UnicodeFlag, ?N] Quantifier - Assertion[U, N] :: + Assertion[UnicodeFlag, N] :: `^` `$` `\` `b` `\` `B` - `(` `?` `=` Disjunction[?U, ?N] `)` - `(` `?` `!` Disjunction[?U, ?N] `)` - `(` `?` `<=` Disjunction[?U, ?N] `)` - `(` `?` `<!` Disjunction[?U, ?N] `)` + `(` `?` `=` Disjunction[?UnicodeFlag, ?N] `)` + `(` `?` `!` Disjunction[?UnicodeFlag, ?N] `)` + `(` `?` `<=` Disjunction[?UnicodeFlag, ?N] `)` + `(` `?` `<!` Disjunction[?UnicodeFlag, ?N] `)` Quantifier :: QuantifierPrefix @@ -30284,13 +30284,13 @@

    Syntax

    `{` DecimalDigits[~Sep] `,` `}` `{` DecimalDigits[~Sep] `,` DecimalDigits[~Sep] `}` - Atom[U, N] :: + Atom[UnicodeFlag, N] :: PatternCharacter `.` - `\` AtomEscape[?U, ?N] - CharacterClass[?U] - `(` GroupSpecifier[?U] Disjunction[?U, ?N] `)` - `(` `?` `:` Disjunction[?U, ?N] `)` + `\` AtomEscape[?UnicodeFlag, ?N] + CharacterClass[?UnicodeFlag] + `(` GroupSpecifier[?UnicodeFlag] Disjunction[?UnicodeFlag, ?N] `)` + `(` `?` `:` Disjunction[?UnicodeFlag, ?N] `)` SyntaxCharacter :: one of `^` `$` `\` `.` `*` `+` `?` `(` `)` `[` `]` `{` `}` `|` @@ -30298,19 +30298,19 @@

    Syntax

    PatternCharacter :: SourceCharacter but not SyntaxCharacter - AtomEscape[U, N] :: + AtomEscape[UnicodeFlag, N] :: DecimalEscape - CharacterClassEscape[?U] - CharacterEscape[?U] - [+N] `k` GroupName[?U] + CharacterClassEscape[?UnicodeFlag] + CharacterEscape[?UnicodeFlag] + [+N] `k` GroupName[?UnicodeFlag] - CharacterEscape[U] :: + CharacterEscape[UnicodeFlag] :: ControlEscape `c` ControlLetter `0` [lookahead <! DecimalDigit] HexEscapeSequence - RegExpUnicodeEscapeSequence[?U] - IdentityEscape[?U] + RegExpUnicodeEscapeSequence[?UnicodeFlag] + IdentityEscape[?UnicodeFlag] ControlEscape :: one of `f` `n` `r` `t` `v` @@ -30319,39 +30319,39 @@

    Syntax

    `a` `b` `c` `d` `e` `f` `g` `h` `i` `j` `k` `l` `m` `n` `o` `p` `q` `r` `s` `t` `u` `v` `w` `x` `y` `z` `A` `B` `C` `D` `E` `F` `G` `H` `I` `J` `K` `L` `M` `N` `O` `P` `Q` `R` `S` `T` `U` `V` `W` `X` `Y` `Z` - GroupSpecifier[U] :: + GroupSpecifier[UnicodeFlag] :: [empty] - `?` GroupName[?U] + `?` GroupName[?UnicodeFlag] - GroupName[U] :: - `<` RegExpIdentifierName[?U] `>` + GroupName[UnicodeFlag] :: + `<` RegExpIdentifierName[?UnicodeFlag] `>` - RegExpIdentifierName[U] :: - RegExpIdentifierStart[?U] - RegExpIdentifierName[?U] RegExpIdentifierPart[?U] + RegExpIdentifierName[UnicodeFlag] :: + RegExpIdentifierStart[?UnicodeFlag] + RegExpIdentifierName[?UnicodeFlag] RegExpIdentifierPart[?UnicodeFlag] - RegExpIdentifierStart[U] :: + RegExpIdentifierStart[UnicodeFlag] :: UnicodeIDStart `$` `_` - `\` RegExpUnicodeEscapeSequence[+U] - [~U] UnicodeLeadSurrogate UnicodeTrailSurrogate + `\` RegExpUnicodeEscapeSequence[+UnicodeFlag] + [~UnicodeFlag] UnicodeLeadSurrogate UnicodeTrailSurrogate - RegExpIdentifierPart[U] :: + RegExpIdentifierPart[UnicodeFlag] :: UnicodeIDContinue `$` - `\` RegExpUnicodeEscapeSequence[+U] - [~U] UnicodeLeadSurrogate UnicodeTrailSurrogate + `\` RegExpUnicodeEscapeSequence[+UnicodeFlag] + [~UnicodeFlag] UnicodeLeadSurrogate UnicodeTrailSurrogate <ZWNJ> <ZWJ> - RegExpUnicodeEscapeSequence[U] :: - [+U] `u` HexLeadSurrogate `\u` HexTrailSurrogate - [+U] `u` HexLeadSurrogate - [+U] `u` HexTrailSurrogate - [+U] `u` HexNonSurrogate - [~U] `u` Hex4Digits - [+U] `u{` CodePoint `}` + RegExpUnicodeEscapeSequence[UnicodeFlag] :: + [+UnicodeFlag] `u` HexLeadSurrogate `\u` HexTrailSurrogate + [+UnicodeFlag] `u` HexLeadSurrogate + [+UnicodeFlag] `u` HexTrailSurrogate + [+UnicodeFlag] `u` HexNonSurrogate + [~UnicodeFlag] `u` Hex4Digits + [+UnicodeFlag] `u{` CodePoint `}` UnicodeLeadSurrogate :: > any Unicode code point in the inclusive range 0xD800 to 0xDBFF @@ -30370,23 +30370,23 @@

    Syntax

    HexNonSurrogate :: Hex4Digits [> but only if the MV of |Hex4Digits| is not in the inclusive range 0xD800 to 0xDFFF] - IdentityEscape[U] :: - [+U] SyntaxCharacter - [+U] `/` - [~U] SourceCharacter but not UnicodeIDContinue + IdentityEscape[UnicodeFlag] :: + [+UnicodeFlag] SyntaxCharacter + [+UnicodeFlag] `/` + [~UnicodeFlag] SourceCharacter but not UnicodeIDContinue DecimalEscape :: NonZeroDigit DecimalDigits[~Sep]? [lookahead <! DecimalDigit] - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeFlag] :: `d` `D` `s` `S` `w` `W` - [+U] `p{` UnicodePropertyValueExpression `}` - [+U] `P{` UnicodePropertyValueExpression `}` + [+UnicodeFlag] `p{` UnicodePropertyValueExpression `}` + [+UnicodeFlag] `P{` UnicodePropertyValueExpression `}` UnicodePropertyValueExpression :: UnicodePropertyName `=` UnicodePropertyValue @@ -30415,37 +30415,37 @@

    Syntax

    ControlLetter `_` - CharacterClass[U] :: - `[` [lookahead != `^`] ClassRanges[?U] `]` - `[` `^` ClassRanges[?U] `]` + CharacterClass[UnicodeFlag] :: + `[` [lookahead != `^`] ClassRanges[?UnicodeFlag] `]` + `[` `^` ClassRanges[?UnicodeFlag] `]` - ClassRanges[U] :: + ClassRanges[UnicodeFlag] :: [empty] - NonemptyClassRanges[?U] + NonemptyClassRanges[?UnicodeFlag] - NonemptyClassRanges[U] :: - ClassAtom[?U] - ClassAtom[?U] NonemptyClassRangesNoDash[?U] - ClassAtom[?U] `-` ClassAtom[?U] ClassRanges[?U] + NonemptyClassRanges[UnicodeFlag] :: + ClassAtom[?UnicodeFlag] + ClassAtom[?UnicodeFlag] NonemptyClassRangesNoDash[?UnicodeFlag] + ClassAtom[?UnicodeFlag] `-` ClassAtom[?UnicodeFlag] ClassRanges[?UnicodeFlag] - NonemptyClassRangesNoDash[U] :: - ClassAtom[?U] - ClassAtomNoDash[?U] NonemptyClassRangesNoDash[?U] - ClassAtomNoDash[?U] `-` ClassAtom[?U] ClassRanges[?U] + NonemptyClassRangesNoDash[UnicodeFlag] :: + ClassAtom[?UnicodeFlag] + ClassAtomNoDash[?UnicodeFlag] NonemptyClassRangesNoDash[?UnicodeFlag] + ClassAtomNoDash[?UnicodeFlag] `-` ClassAtom[?UnicodeFlag] ClassRanges[?UnicodeFlag] - ClassAtom[U] :: + ClassAtom[UnicodeFlag] :: `-` - ClassAtomNoDash[?U] + ClassAtomNoDash[?UnicodeFlag] - ClassAtomNoDash[U] :: + ClassAtomNoDash[UnicodeFlag] :: SourceCharacter but not one of `\` or `]` or `-` - `\` ClassEscape[?U] + `\` ClassEscape[?UnicodeFlag] - ClassEscape[U] :: + ClassEscape[UnicodeFlag] :: `b` - [+U] `-` - CharacterClassEscape[?U] - CharacterEscape[?U] + [+UnicodeFlag] `-` + CharacterClassEscape[?UnicodeFlag] + CharacterEscape[?UnicodeFlag]
    @@ -30502,25 +30502,25 @@

    Static Semantics: Early Errors

    It is a Syntax Error if IsCharacterClass of |ClassAtomNoDash| is *false* and IsCharacterClass of |ClassAtom| is *false* and the CharacterValue of |ClassAtomNoDash| is larger than the CharacterValue of |ClassAtom|.
  • - RegExpIdentifierStart[U] :: `\` RegExpUnicodeEscapeSequence[+U] + RegExpIdentifierStart[UnicodeFlag] :: `\` RegExpUnicodeEscapeSequence[+UnicodeFlag] - RegExpIdentifierStart[U] :: UnicodeLeadSurrogate UnicodeTrailSurrogate + RegExpIdentifierStart[UnicodeFlag] :: UnicodeLeadSurrogate UnicodeTrailSurrogate - RegExpIdentifierPart[U] :: `\` RegExpUnicodeEscapeSequence[+U] + RegExpIdentifierPart[UnicodeFlag] :: `\` RegExpUnicodeEscapeSequence[+UnicodeFlag] - RegExpIdentifierPart[U] :: UnicodeLeadSurrogate UnicodeTrailSurrogate + RegExpIdentifierPart[UnicodeFlag] :: UnicodeLeadSurrogate UnicodeTrailSurrogate