Skip to content

Commit

Permalink
Normative: Revert U+2212 from offset grammar
Browse files Browse the repository at this point in the history
This PR is the Temporal counterpart to
tc39/ecma262#3334.

See that PR for details.

This PR is dependent on that PR's approval.
  • Loading branch information
justingrant committed May 23, 2024
1 parent 514c656 commit e4a20e6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
23 changes: 11 additions & 12 deletions spec/abstractops.html
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ <h1>ISO 8601 grammar</h1>

DateYear :::
DecimalDigit DecimalDigit DecimalDigit DecimalDigit
TemporalSign DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit
ASCIISign DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit

DateMonth :::
`0` NonZeroDigit
Expand Down Expand Up @@ -1262,15 +1262,15 @@ <h1>ISO 8601 grammar</h1>
TemporalDecimalFraction

UTCOffsetWithSubMinuteComponents[Extended] :::
TemporalSign Hour TimeSeparator[?Extended] MinuteSecond TimeSeparator[?Extended] MinuteSecond TemporalDecimalFraction?
ASCIISign Hour TimeSeparator[?Extended] MinuteSecond TimeSeparator[?Extended] MinuteSecond TemporalDecimalFraction?

NormalizedUTCOffset :::
ASCIISign Hour `:` MinuteSecond

UTCOffsetMinutePrecision :::
TemporalSign Hour
TemporalSign Hour TimeSeparator[+Extended] MinuteSecond
TemporalSign Hour TimeSeparator[~Extended] MinuteSecond
ASCIISign Hour
ASCIISign Hour TimeSeparator[+Extended] MinuteSecond
ASCIISign Hour TimeSeparator[~Extended] MinuteSecond

UTCOffsetSubMinutePrecision :::
UTCOffsetMinutePrecision
Expand Down Expand Up @@ -1437,8 +1437,8 @@ <h1>ISO 8601 grammar</h1>
DurationDaysPart DurationTime?

Duration :::
TemporalSign? DurationDesignator DurationDate
TemporalSign? DurationDesignator DurationTime
ASCIISign? DurationDesignator DurationDate
ASCIISign? DurationDesignator DurationTime

TemporalInstantString :::
Date DateTimeSeparator TimeSpec DateTimeUTCOffset TimeZoneAnnotation? Annotations?
Expand Down Expand Up @@ -1466,11 +1466,11 @@ <h1>ISO 8601 grammar</h1>
<h1>Static Semantics: Early Errors</h1>
<emu-grammar>
DateYear :::
TemporalSign DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit
ASCIISign DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit DecimalDigit
</emu-grammar>
<ul>
<li>
It is a Syntax Error if |DateYear| is *"-000000"* or *"−000000"* (U+2212 MINUS SIGN followed by `000000`).
It is a Syntax Error if |DateYear| is *"-000000"*.
</li>
</ul>
</emu-clause>
Expand Down Expand Up @@ -1504,7 +1504,6 @@ <h1>
1. If _foundCalendar_ is not *undefined* and the ASCII-lowercase of _foundCalendar_ is not *"iso8601"*, throw a *RangeError* exception.
1. If _parseResult_ is not a Parse Node, throw a *RangeError* exception.
1. Let each of _year_, _month_, _day_, _hour_, _minute_, _second_, and _fSeconds_ be the source text matched by the respective |DateYear|, |DateMonth|, |DateDay|, |TimeHour|, |TimeMinute|, |TimeSecond|, and |TimeFraction| Parse Node contained within _parseResult_, or an empty sequence of code points if not present.
1. If the first code point of _year_ is U+2212 (MINUS SIGN), replace the first code point with U+002D (HYPHEN-MINUS).
1. Let _yearMV_ be ! ToIntegerOrInfinity(CodePointsToString(_year_)).
1. If _month_ is empty, then
1. Let _monthMV_ be 1.
Expand Down Expand Up @@ -1695,7 +1694,7 @@ <h1>
<emu-alg>
1. Let _duration_ be ParseText(StringToCodePoints(_isoString_), |TemporalDurationString|).
1. If _duration_ is a List of errors, throw a *RangeError* exception.
1. Let each of _sign_, _years_, _months_, _weeks_, _days_, _hours_, _fHours_, _minutes_, _fMinutes_, _seconds_, and _fSeconds_ be the source text matched by the respective |TemporalSign|, |DurationYears|, |DurationMonths|, |DurationWeeks|, |DurationDays|, |DurationWholeHours|, |DurationHoursFraction|, |DurationWholeMinutes|, |DurationMinutesFraction|, |DurationWholeSeconds|, and |DurationSecondsFraction| Parse Node contained within _duration_, or an empty sequence of code points if not present.
1. Let each of _sign_, _years_, _months_, _weeks_, _days_, _hours_, _fHours_, _minutes_, _fMinutes_, _seconds_, and _fSeconds_ be the source text matched by the respective |ASCIISign|, |DurationYears|, |DurationMonths|, |DurationWeeks|, |DurationDays|, |DurationWholeHours|, |DurationHoursFraction|, |DurationWholeMinutes|, |DurationMinutesFraction|, |DurationWholeSeconds|, and |DurationSecondsFraction| Parse Node contained within _duration_, or an empty sequence of code points if not present.
1. Let _yearsMV_ be ? ToIntegerWithTruncation(CodePointsToString(_years_)).
1. Let _monthsMV_ be ? ToIntegerWithTruncation(CodePointsToString(_months_)).
1. Let _weeksMV_ be ? ToIntegerWithTruncation(CodePointsToString(_weeks_)).
Expand Down Expand Up @@ -1725,7 +1724,7 @@ <h1>
1. Let _millisecondsMV_ be remainder(_secondsMV_, 1) &times; 1000.
1. Let _microsecondsMV_ be remainder(_millisecondsMV_, 1) &times; 1000.
1. Let _nanosecondsMV_ be remainder(_microsecondsMV_, 1) &times; 1000.
1. If _sign_ contains the code point U+002D (HYPHEN-MINUS) or U+2212 (MINUS SIGN), then
1. If _sign_ contains the code point U+002D (HYPHEN-MINUS), then
1. Let _factor_ be -1.
1. Else,
1. Let _factor_ be 1.
Expand Down
6 changes: 3 additions & 3 deletions spec/mainadditions.html
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,9 @@ <h1>
1. Let _parseResult_ be ParseText(StringToCodePoints(_offsetString_), <del>|UTCOffset|</del><ins>|UTCOffsetSubMinutePrecision|</ins>).
1. <del>Assert: _parseResult_ is not a List of errors.</del>
1. <ins>If _parseResult_ is a List of errors, throw a *RangeError* exception.</ins>
1. Assert: _parseResult_ contains a |TemporalSign| Parse Node.
1. Let _parsedSign_ be the source text matched by the |TemporalSign| Parse Node contained within _parseResult_.
1. If _parsedSign_ is the single code point U+002D (HYPHEN-MINUS) or U+2212 (MINUS SIGN), then
1. Assert: _parseResult_ contains a |ASCIISign| Parse Node.
1. Let _parsedSign_ be the source text matched by the |ASCIISign| Parse Node contained within _parseResult_.
1. If _parsedSign_ is the single code point U+002D (HYPHEN-MINUS), then
1. Let _sign_ be -1.
1. Else,
1. Let _sign_ be 1.
Expand Down

0 comments on commit e4a20e6

Please sign in to comment.