From 3d1c29c633ca5b557d634edbfb90fd4c6ae9703a Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 25 Feb 2021 20:37:13 -0800 Subject: [PATCH] Apply suggestions from code review --- spec.html | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/spec.html b/spec.html index f9a445a2549..2efc8b8ea32 100644 --- a/spec.html +++ b/spec.html @@ -31070,10 +31070,9 @@

AdvanceStringIndex ( _S_, _index_, _unicode_ )

GetStringIndex ( _S_, _Input_, _e_ )

-

The abstract operation GetStringIndex takes arguments _S_, _Input_, and _e_. It performs the following steps when called:

+

The abstract operation GetStringIndex takes arguments _S_ (a String), _Input_ (a List), and _e_. It performs the following steps when called:

- 1. Assert: Type(_S_) is String. - 1. Assert: _Input_ is a List of the code points of _S_ interpreted as a UTF-16 encoded string. + 1. Assert: _Input_ contains the code points of _S_ interpreted as a UTF-16 encoded string. 1. Assert: _e_ is an integer value ≥ 0. 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_. @@ -31110,10 +31109,8 @@

Match Records

GetMatchString ( _S_, _match_ )

-

The abstract operation GetMatchString takes arguments _S_ and _match_. It performs the following steps when called:

+

The abstract operation GetMatchString takes arguments _S_ (a String) and _match_ (a Match Record). It performs the following steps when called:

- 1. Assert: Type(_S_) is String. - 1. Assert: _match_ is a Match Record. 1. Assert: _match_.[[StartIndex]] is an integer value ≥ 0 and ≤ the length of _S_. 1. Assert: _match_.[[EndIndex]] is an integer value ≥ _match_.[[StartIndex]] and ≤ the length of _S_. 1. Return the substring of _S_ from _match_.[[StartIndex]] to _match_.[[EndIndex]]. @@ -31122,10 +31119,8 @@

GetMatchString ( _S_, _match_ )

GetMatchIndicesArray ( _S_, _match_ )

-

The abstract operation GetMatchIndicesArray takes arguments _S_ and _match_. It performs the following steps when called:

+

The abstract operation GetMatchIndicesArray takes arguments _S_ (a String) and _match_ (a Match Record). It performs the following steps when called:

- 1. Assert: Type(_S_) is String. - 1. Assert: _match_ is a Match Record. 1. Assert: _match_.[[StartIndex]] is an integer value ≥ 0 and < the length of _S_. 1. Assert: _match_.[[EndIndex]] is an integer value ≥ _match_.[[StartIndex]] and ≤ the length of _S_. 1. Return ! CreateArrayFromList(« 𝔽(_match_.[[StartIndex]]), 𝔽(_match_.[[EndIndex]]) »). @@ -31134,15 +31129,12 @@

GetMatchIndicesArray ( _S_, _match_ )

MakeIndicesArray ( _S_, _indices_, _groupNames_, _hasGroups_ )

-

The abstract operation MakeIndicesArray takes arguments _S_, _indices_, _groupNames_, and _hasGroups_. It performs the following steps when called:

+

The abstract operation MakeIndicesArray takes arguments _S_ (a String), _indices_ (a List), _groupNames_ (a List), and _hasGroups_ (a Boolean). It performs the following steps when called:

- 1. Assert: Type(_S_) is String. - 1. Assert: _indices_ is a List. 1. Let _n_ be the number of elements in _indices_. 1. Assert: _n_ < 232 - 1. - 1. Assert: _groupNames_ is a List with _n_ - 1 elements. + 1. Assert: _groupNames_ has _n_ - 1 elements. 1. NOTE: The _groupNames_ List contains elements aligned with the _indices_ List starting at _indices_[1]. - 1. Assert: Type(_hasGroups_) is Boolean. 1. Let _A_ be ! ArrayCreate(_n_). 1. Assert: The value of _A_'s *"length"* property is 𝔽(_n_). 1. If _hasGroups_ is *true*, then