Skip to content

Commit

Permalink
Rename several AOs plus other PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Feb 4, 2022
1 parent 0fe72de commit 58e18b7
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -34902,7 +34902,7 @@ <h1>Notation</h1>
A <em>CharSet</em> is a mathematical set of characters. When the _Unicode_ flag is *true*, &ldquo;all characters&rdquo; means the CharSet containing all code point values; otherwise &ldquo;all characters&rdquo; means the CharSet containing all code unit values.
</li>
<li>
A <em>Range</em> is an ordered pair (_startIndex_, _endIndex_) that represents the range of characters included in a capture, where _startIndex_ is an integer representing the start index (inclusive) of the range within _Input_ and _endIndex_ is an integer representing the end index (exclusive) of the range within _Input_. For any <em>Range</em>, these indices must satisfy the invariant that _startIndex_ &le; _endIndex_.
A <em>Range</em> is an ordered pair (_startIndex_, _endIndex_) that represents the range of characters included in a capture, where _startIndex_ is an integer representing the start index (inclusive) of the range within _Input_, and _endIndex_ is an integer representing the end index (exclusive) of the range within _Input_. For any <em>Range</em>, these indices must satisfy the invariant that _startIndex_ &le; _endIndex_.
</li>
<li>
A <em>State</em> is an ordered pair (_endIndex_, _captures_) where _endIndex_ is an integer and _captures_ is a List of _NcapturingParens_ values. States are used to represent partial match states in the regular expression matching algorithms. The _endIndex_ is one plus the index of the last input character matched so far by the pattern, while _captures_ holds the results of capturing parentheses. The _n_<sup>th</sup> element of _captures_ is either a <em>Range</em> representing the range of characters captured by the _n_<sup>th</sup> set of capturing parentheses, or *undefined* if the _n_<sup>th</sup> set of capturing parentheses hasn't been reached yet. Due to backtracking, many States may be in use at any time during the matching process.
Expand Down Expand Up @@ -36002,7 +36002,7 @@ <h1>
1. Assert: _r_ is a State.
1. Set _matchSucceeded_ to *true*.
1. Let _e_ be _r_'s _endIndex_ value.
1. If _fullUnicode_ is *true*, set _e_ to ! GetStringIndex(_S_, _input_, _e_).
1. If _fullUnicode_ is *true*, set _e_ to ! GetStringIndex(_S_, _e_).
1. If _global_ is *true* or _sticky_ is *true*, then
1. Perform ? Set(_R_, *"lastIndex"*, 𝔽(_e_), *true*).
1. Let _n_ be the number of elements in _r_'s _captures_ List. (This is the same value as <emu-xref href="#sec-notation"></emu-xref>'s _NcapturingParens_.)
Expand Down Expand Up @@ -36033,8 +36033,8 @@ <h1>
1. Let _captureStart_ be _captureI_'s _startIndex_.
1. Let _captureEnd_ be _captureI_'s _endIndex_.
1. If _fullUnicode_ is *true*, then
1. Set _captureStart_ to ! GetStringIndex(_S_, _input_, _captureStart_).
1. Set _captureEnd_ to ! GetStringIndex(_S_, _input_, _captureEnd_).
1. Set _captureStart_ to ! GetStringIndex(_S_, _captureStart_).
1. Set _captureEnd_ to ! GetStringIndex(_S_, _captureEnd_).
1. Let _capture_ be the Match Record { [[StartIndex]]: _captureStart_, [[EndIndex]]: _captureEnd_ }.
1. Let _capturedValue_ be ! GetMatchString(_S_, _capture_).
1. Append _capture_ to _indices_.
Expand All @@ -36046,7 +36046,7 @@ <h1>
1. Else,
1. Append *undefined* to _groupNames_.
1. If _hasIndices_ is *true*, then
1. Let _indicesArray_ be ! MakeIndicesArray(_S_, _indices_, _groupNames_, _hasGroups_).
1. Let _indicesArray_ be ! MakeMatchIndicesIndexPairArray(_S_, _indices_, _groupNames_, _hasGroups_).
1. Perform ! CreateDataPropertyOrThrow(_A_, *"indices"*, _indicesArray_).
1. Return _A_.
</emu-alg>
Expand Down Expand Up @@ -36076,23 +36076,22 @@ <h1>
<h1>
GetStringIndex (
_S_: a String,
_Input_: a List of characters derived from _S_,
_e_: a non-negative integer,
)
</h1>
<dl class="header">
</dl>
<emu-alg>
1. Assert: _Input_ contains the code points of StringToCodePoints(_S_).
1. If _S_ is the empty String, return 0.
1. Let _eUTF_ be the smallest index into _S_ that corresponds to the character at element _e_ of _Input_. If _e_ is greater than or equal to the number of elements in _Input_, then _eUTF_ is the number of code units in _S_.
1. Let _codepoints_ be StringToCodePoints(_S_).
1. Let _eUTF_ be the smallest index into _S_ that corresponds to the character at element _e_ of _codepoints_. If _e_ is greater than or equal to the number of elements in _codepoints_, then _eUTF_ is the number of code units in _S_.
1. Return _eUTF_.
</emu-alg>
</emu-clause>

<emu-clause id="sec-match-records">
<h1>Match Records</h1>
<p>A <dfn>Match Record</dfn> is a Record value used to encapsulate the start and end indices of a regular expression match or capture.</p>
<p>A <dfn variants="Match Records">Match Record</dfn> is a Record value used to encapsulate the start and end indices of a regular expression match or capture.</p>
<p>Match Records have the fields listed in <emu-xref href="#table-match-record"></emu-xref>.</p>
<emu-table id="table-match-record" caption="Match Record Fields">
<table>
Expand Down Expand Up @@ -36131,9 +36130,9 @@ <h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-getmatchindicesarray" type="abstract operation">
<emu-clause id="sec-getmatchindexpair" type="abstract operation">
<h1>
GetMatchIndicesArray (
GetMatchIndexPair (
_S_: a String,
_match_: a Match Record,
)
Expand All @@ -36147,9 +36146,9 @@ <h1>
</emu-alg>
</emu-clause>

<emu-clause id="sec-makeindicesarray" type="abstract operation">
<emu-clause id="sec-makematchindicesindexpairarray" type="abstract operation">
<h1>
MakeIndicesArray (
MakeMatchIndicesIndexPairArray (
_S_: a String,
_indices_: a List, each of whose elements is a Match Record or *undefined*,
_groupNames_: a List, each of whose elements is a String or *undefined*,
Expand All @@ -36170,15 +36169,15 @@ <h1>
1. Else,
1. Let _groups_ be *undefined*.
1. Perform ! CreateDataPropertyOrThrow(_A_, *"groups"*, _groups_).
1. For each integer _i_ such that _i_ &ge; 0 and _i_ &lt; _n_, do
1. For each integer _i_ starting with 0 such that _i_ &lt; _n_, in ascending order, do
1. Let _matchIndices_ be _indices_[_i_].
1. If _matchIndices_ is not *undefined*, then
1. Let _matchIndicesArray_ be ! GetMatchIndicesArray(_S_, _matchIndices_).
1. Let _matchIndexPair_ be ! GetMatchIndexPair(_S_, _matchIndices_).
1. Else,
1. Let _matchIndicesArray_ be *undefined*.
1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_i_)), _matchIndicesArray_).
1. Let _matchIndexPair_ be *undefined*.
1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_i_)), _matchIndexPair_).
1. If _i_ &gt; 0 and _groupNames_[_i_ - 1] is not *undefined*, then
1. Perform ! CreateDataPropertyOrThrow(_groups_, _groupNames_[_i_ - 1], _matchIndicesArray_).
1. Perform ! CreateDataPropertyOrThrow(_groups_, _groupNames_[_i_ - 1], _matchIndexPair_).
1. Return _A_.
</emu-alg>
</emu-clause>
Expand Down

0 comments on commit 58e18b7

Please sign in to comment.