Skip to content

Commit

Permalink
Normative: allow named backreferences without u flag in non-Annex B
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Jun 14, 2021
1 parent c7d208f commit 7579276
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -31732,14 +31732,15 @@ <h1>RegExpInitialize ( _obj_, _pattern_, _flags_ )</h1>

<emu-clause id="sec-parsepattern" aoid="ParsePattern">
<h1>Static Semantics: ParsePattern ( _patternText_, _u_ )</h1>
<emu-note>
<p>This section is amended in <emu-xref href="#sec-parsepattern-annexb"></emu-xref>.</p>
</emu-note>
<p>The abstract operation ParsePattern takes arguments _patternText_ (a sequence of Unicode code points) and _u_ (a Boolean). It performs the following steps when called:</p>
<emu-alg>
1. If _u_ is *true*, then
1. Let _parseResult_ be ParseText(_patternText_, |Pattern[+U, +N]|).
1. Else,
1. Let _parseResult_ be ParseText(_patternText_, |Pattern[~U, ~N]|).
1. If _parseResult_ is a Parse Node and _parseResult_ contains a |GroupName|, then
1. Set _parseResult_ to ParseText(_patternText_, |Pattern[~U, +N]|).
1. Let _parseResult_ be ParseText(_patternText_, |Pattern[~U, +N]|).
1. Return _parseResult_.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -42156,6 +42157,21 @@ <h1>CharacterRangeOrUnion ( _A_, _B_ )</h1>
</emu-alg>
</emu-annex>
</emu-annex>

<emu-annex id="sec-parsepattern-annexb">
<h1>Static Semantics: ParsePattern ( _patternText_, _u_ )</h1>
<p>The semantics of <emu-xref href="#sec-parsepattern"></emu-xref> is extended as follows:</p>
<p>The abstract operation ParsePattern takes arguments _patternText_ (a sequence of Unicode code points) and _u_ (a Boolean). It performs the following steps when called:</p>
<emu-alg>
1. If _u_ is *true*, then
1. Let _parseResult_ be ParseText(_patternText_, |Pattern[+U, +N]|).
1. Else,
1. Let _parseResult_ be ParseText(_patternText_, |Pattern[~U, ~N]|).
1. If _parseResult_ is a Parse Node and _parseResult_ contains a |GroupName|, then
1. Set _parseResult_ to ParseText(_patternText_, |Pattern[~U, +N]|).
1. Return _parseResult_.
</emu-alg>
</emu-annex>
</emu-annex>
</emu-annex>

Expand Down

0 comments on commit 7579276

Please sign in to comment.