Skip to content

Commit

Permalink
Editorial: Use consistent wording for List iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Apr 12, 2023
1 parent 6832aaf commit c3def6b
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 25 deletions.
21 changes: 11 additions & 10 deletions spec/datetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h1>InitializeDateTimeFormat ( _dateTimeFormat_, _locales_, _options_ )</h1>
1. Let _bestFormat_ be BasicFormatMatcher(_formatOptions_, _formats_).
1. Else,
1. Let _bestFormat_ be BestFitFormatMatcher(_formatOptions_, _formats_).
1. For each row in <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, in table order, do
1. For each row of <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, in table order, do
1. Let _prop_ be the name given in the Property column of the row.
1. If _bestFormat_ has a field [[&lt;_prop_&gt;]], then
1. Let _p_ be _bestFormat_.[[&lt;_prop_&gt;]].
Expand Down Expand Up @@ -834,7 +834,8 @@ <h1>BasicFormatMatcher ( _options_, _formats_ )</h1>
1. Assert: Type(_formats_) is List.
1. For each element _format_ of _formats_, do
1. Let _score_ be 0.
1. For each property name _property_ shown in <emu-xref href="#table-datetimeformat-components"></emu-xref>, do
1. For each row of <emu-xref href="#table-datetimeformat-components"></emu-xref>, except the header row, in table order, do
1. Let _property_ be the name given in the Property column of the row.
1. If _options_ has a field [[&lt;_property_&gt;]], let _optionsProp_ be _options_.[[&lt;_property_&gt;]]; else let _optionsProp_ be *undefined*.
1. If _format_ has a field [[&lt;_property_&gt;]], let _formatProp_ be _format_.[[&lt;_property_&gt;]]; else let _formatProp_ be *undefined*.
1. If _optionsProp_ is *undefined* and _formatProp_ is not *undefined*, decrease _score_ by _additionPenalty_.
Expand Down Expand Up @@ -929,7 +930,7 @@ <h1>FormatDateTimePattern ( _dateTimeFormat_, _patternParts_, _x_, _rangeFormatO
1. Let _nf3_ be ? Construct(%NumberFormat%, &laquo; _locale_, _nf3Options_ &raquo;).
1. Let _tm_ be ToLocalTime(ℤ(ℝ(_x_) &times; 10<sup>6</sup>), _dateTimeFormat_.[[Calendar]], _dateTimeFormat_.[[TimeZone]]).
1. Let _result_ be a new empty List.
1. For each Record { [[Type]], [[Value]] } _patternPart_ in _patternParts_, do
1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do
1. Let _p_ be _patternPart_.[[Type]].
1. If _p_ is *"literal"*, then
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_.
Expand Down Expand Up @@ -1015,7 +1016,7 @@ <h1>FormatDateTime ( _dateTimeFormat_, _x_ )</h1>
<emu-alg>
1. Let _parts_ be ? PartitionDateTimePattern(_dateTimeFormat_, _x_).
1. Let _result_ be the empty String.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -1032,7 +1033,7 @@ <h1>FormatDateTimeToParts ( _dateTimeFormat_, _x_ )</h1>
1. Let _parts_ be ? PartitionDateTimePattern(_dateTimeFormat_, _x_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down Expand Up @@ -1090,13 +1091,13 @@ <h1>PartitionDateTimeRangePattern ( _dateTimeFormat_, _x_, _y_ )</h1>
1. Let _pattern_ be _dateTimeFormat_.[[Pattern]].
1. Let _patternParts_ be PartitionPattern(_pattern_).
1. Let _resultParts_ be ? FormatDateTimePattern(_dateTimeFormat_, _patternParts_, _x_, *undefined*).
1. For each Record { [[Type]], [[Value]] } _r_ in _resultParts_, do
1. For each Record { [[Type]], [[Value]] } _r_ of _resultParts_, do
1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: *"shared"* } to _collapsedResult_.
1. Return _collapsedResult_.
1. Let _rangeResult_ be a new empty List.
1. If _selectedRangePattern_ is *undefined*, then
1. Set _selectedRangePattern_ to _rangePatterns_.[[Default]].
1. For each Record { [[Pattern]], [[Source]] } _rangePatternPart_ in _selectedRangePattern_.[[PatternParts]], do
1. For each Record { [[Pattern]], [[Source]] } _rangePatternPart_ of _selectedRangePattern_.[[PatternParts]], do
1. Let _pattern_ be _rangePatternPart_.[[Pattern]].
1. Let _source_ be _rangePatternPart_.[[Source]].
1. If _source_ is *"startRange"* or *"shared"*, then
Expand All @@ -1105,7 +1106,7 @@ <h1>PartitionDateTimeRangePattern ( _dateTimeFormat_, _x_, _y_ )</h1>
1. Let _z_ be _y_.
1. Let _patternParts_ be PartitionPattern(_pattern_).
1. Let _resultParts_ be ? FormatDateTimePattern(_dateTimeFormat_, _patternParts_, _z_, _selectedRangePattern_).
1. For each Record { [[Type]], [[Value]] } _r_ in _resultParts_, do
1. For each Record { [[Type]], [[Value]] } _r_ of _resultParts_, do
1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: _source_ } to _rangeResult_.
1. Return _rangeResult_.
</emu-alg>
Expand All @@ -1121,7 +1122,7 @@ <h1>FormatDateTimeRange ( _dateTimeFormat_, _x_, _y_ )</h1>
<emu-alg>
1. Let _parts_ be ? PartitionDateTimeRangePattern(_dateTimeFormat_, _x_, _y_).
1. Let _result_ be the empty String.
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -1138,7 +1139,7 @@ <h1>FormatDateTimeRangeToParts ( _dateTimeFormat_, _x_, _y_ )</h1>
1. Let _parts_ be ? PartitionDateTimeRangePattern(_dateTimeFormat_, _x_, _y_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]], [[Source]] } _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down
4 changes: 2 additions & 2 deletions spec/listformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ <h1>FormatList ( _listFormat_, _list_ )</h1>
<emu-alg>
1. Let _parts_ be ! CreatePartsFromList(_listFormat_, _list_).
1. Let _result_ be an empty String.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -347,7 +347,7 @@ <h1>FormatListToParts ( _listFormat_, _list_ )</h1>
1. Let _parts_ be ! CreatePartsFromList(_listFormat_, _list_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down
2 changes: 1 addition & 1 deletion spec/locales-currencies-tz.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h1>CanonicalizeUnicodeLocaleId ( _locale_ )</h1>
1. For each element _attr_ of _attributes_, do
1. Append *"-"* to _newExtension_.
1. Append _attr_ to _newExtension_.
1. For each Record { [[Key]], [[Value]] } _keyword_ in _keywords_, do
1. For each Record { [[Key]], [[Value]] } _keyword_ of _keywords_, do
1. Append *"-"* to _newExtension_.
1. Append _keyword_.[[Key]] to _newExtension_.
1. If _keyword_.[[Value]] is not the empty String, then
Expand Down
16 changes: 8 additions & 8 deletions spec/numberformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ <h1>
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]] } to _result_.
1. Else if _p_ is equal to *"number"*, then
1. Let _notationSubParts_ be PartitionNotationSubPattern(_numberFormat_, _x_, _n_, _exponent_).
1. For each Record { [[Type]], [[Value]] } _subPart_ in _notationSubParts_, do
1. For each Record { [[Type]], [[Value]] } _subPart_ of _notationSubParts_, do
1. Append _subPart_ to _result_.
1. Else if _p_ is equal to *"plusSign"*, then
1. Let _plusSignSymbol_ be the ILND String representing the plus sign.
Expand Down Expand Up @@ -1213,7 +1213,7 @@ <h1>FormatNumeric ( _numberFormat_, _x_ )</h1>
<emu-alg>
1. Let _parts_ be ? PartitionNumberPattern(_numberFormat_, _x_).
1. Let _result_ be the empty String.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -1230,7 +1230,7 @@ <h1>FormatNumericToParts ( _numberFormat_, _x_ )</h1>
1. Let _parts_ be ? PartitionNumberPattern(_numberFormat_, _x_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down Expand Up @@ -1737,14 +1737,14 @@ <h1>PartitionNumberRangePattern ( _numberFormat_, _x_, _y_ )</h1>
1. Let _yResult_ be ? PartitionNumberPattern(_numberFormat_, _y_).
1. If ! FormatNumeric(_numberFormat_, _x_) is equal to ! FormatNumeric(_numberFormat_, _y_), then
1. Let _appxResult_ be ? FormatApproximately(_numberFormat_, _xResult_).
1. For each element _r_ in _appxResult_, do
1. For each element _r_ of _appxResult_, do
1. Set _r_.[[Source]] to *"shared"*.
1. Return _appxResult_.
1. For each element _r_ in _xResult_, do
1. For each element _r_ of _xResult_, do
1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: *"startRange"* } to _result_.
1. Let _rangeSeparator_ be an ILND String value used to separate two numbers.
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _rangeSeparator_, [[Source]]: *"shared"* } to _result_.
1. For each element _r_ in _yResult_, do
1. For each element _r_ of _yResult_, do
1. Append the Record { [[Type]]: _r_.[[Type]], [[Value]]: _r_.[[Value]], [[Source]]: *"endRange"* } to _result_.
1. Return ! CollapseNumberRange(_result_).
</emu-alg>
Expand Down Expand Up @@ -1788,7 +1788,7 @@ <h1>FormatNumericRange ( _numberFormat_, _x_, _y_ )</h1>
<emu-alg>
1. Let _parts_ be ? PartitionNumberRangePattern(_numberFormat_, _x_, _y_).
1. Let _result_ be the empty String.
1. For each element _part_ in _parts_, do
1. For each element _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -1805,7 +1805,7 @@ <h1>FormatNumericRangeToParts ( _numberFormat_, _x_, _y_ )</h1>
1. Let _parts_ be ? PartitionNumberRangePattern(_numberFormat_, _x_, _y_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each element _part_ in _parts_, do
1. For each element _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down
8 changes: 4 additions & 4 deletions spec/relativetimeformat.html
Original file line number Diff line number Diff line change
Expand Up @@ -349,12 +349,12 @@ <h1>MakePartsList ( _pattern_, _unit_, _parts_ )</h1>
<emu-alg>
1. Let _patternParts_ be PartitionPattern(_pattern_).
1. Let _result_ be a new empty List.
1. For each Record { [[Type]], [[Value]] } _patternPart_ in _patternParts_, do
1. For each Record { [[Type]], [[Value]] } _patternPart_ of _patternParts_, do
1. If _patternPart_.[[Type]] is *"literal"*, then
1. Append the Record { [[Type]]: *"literal"*, [[Value]]: _patternPart_.[[Value]], [[Unit]]: ~empty~ } to _result_.
1. Else,
1. Assert: _patternPart_.[[Type]] is *"0"*.
1. For each Record { [[Type]], [[Value]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]] } _part_ of _parts_, do
1. Append the Record { [[Type]]: _part_.[[Type]], [[Value]]: _part_.[[Value]], [[Unit]]: _unit_ } to _result_.
1. Return _result_.
</emu-alg>
Expand All @@ -370,7 +370,7 @@ <h1>FormatRelativeTime ( _relativeTimeFormat_, _value_, _unit_ )</h1>
<emu-alg>
1. Let _parts_ be ? PartitionRelativeTimePattern(_relativeTimeFormat_, _value_, _unit_).
1. Let _result_ be an empty String.
1. For each Record { [[Type]], [[Value]], [[Unit]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]], [[Unit]] } _part_ of _parts_, do
1. Set _result_ to the string-concatenation of _result_ and _part_.[[Value]].
1. Return _result_.
</emu-alg>
Expand All @@ -387,7 +387,7 @@ <h1>FormatRelativeTimeToParts ( _relativeTimeFormat_, _value_, _unit_ )</h1>
1. Let _parts_ be ? PartitionRelativeTimePattern(_relativeTimeFormat_, _value_, _unit_).
1. Let _result_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. For each Record { [[Type]], [[Value]], [[Unit]] } _part_ in _parts_, do
1. For each Record { [[Type]], [[Value]], [[Unit]] } _part_ of _parts_, do
1. Let _O_ be OrdinaryObjectCreate(%Object.prototype%).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"type"*, _part_.[[Type]]).
1. Perform ! CreateDataPropertyOrThrow(_O_, *"value"*, _part_.[[Value]]).
Expand Down

0 comments on commit c3def6b

Please sign in to comment.