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 authored and ljharb committed Feb 15, 2023
1 parent ff706e3 commit f1d2851
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 @@ -36287,15 +36287,16 @@ <h1>
_u_: a Boolean,
): a Parse Node or a non-empty List of *SyntaxError* objects
</h1>
<emu-note>
<p>This section is amended in <emu-xref href="#sec-parsepattern-annexb"></emu-xref>.</p>
</emu-note>
<dl class="header">
</dl>
<emu-alg>
1. If _u_ is *true*, then
1. Let _parseResult_ be ParseText(_patternText_, |Pattern[+UnicodeMode, +N]|).
1. Else,
1. Let _parseResult_ be ParseText(_patternText_, |Pattern[~UnicodeMode, ~N]|).
1. If _parseResult_ is a Parse Node and _parseResult_ contains a |GroupName|, then
1. Set _parseResult_ to ParseText(_patternText_, |Pattern[~UnicodeMode, +N]|).
1. Let _parseResult_ be ParseText(_patternText_, |Pattern[~U, +N]|).
1. Return _parseResult_.
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -47634,6 +47635,21 @@ <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 f1d2851

Please sign in to comment.