From 8df2809d0909832cfe6b30152a885600ce76a62f Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Wed, 20 Dec 2017 22:13:01 -0500 Subject: [PATCH 01/48] Editorial: add more lookahead-restrictions to NotEscapeSequence Specifically, add a [lookahead Syntax `u` HexDigit HexDigit [lookahead <! HexDigit] `u` HexDigit HexDigit HexDigit [lookahead <! HexDigit] `u` `{` [lookahead <! HexDigit] - `u` `{` NotCodePoint - `u` `{` CodePoint [lookahead != `}`] + `u` `{` NotCodePoint [lookahead <! HexDigit] + `u` `{` CodePoint [lookahead <! HexDigit] [lookahead != `}`] NotCodePoint :: HexDigits [> but only if MV of HexDigits > 0x10FFFF ] @@ -10858,10 +10858,10 @@

Static Semantics: TV and TRV

The TRV of NotEscapeSequence :: `u` `{` [lookahead <! HexDigit] is the sequence consisting of the code unit 0x0075 (LATIN SMALL LETTER U) followed by the code unit 0x007B (LEFT CURLY BRACKET).
  • - The TRV of NotEscapeSequence :: `u` `{` NotCodePoint is the sequence consisting of the code unit 0x0075 (LATIN SMALL LETTER U) followed by the code unit 0x007B (LEFT CURLY BRACKET) followed by the code units of the TRV of |NotCodePoint|. + The TRV of NotEscapeSequence :: `u` `{` NotCodePoint [lookahead <! HexDigit] is the sequence consisting of the code unit 0x0075 (LATIN SMALL LETTER U) followed by the code unit 0x007B (LEFT CURLY BRACKET) followed by the code units of the TRV of |NotCodePoint|.
  • - The TRV of NotEscapeSequence :: `u` `{` CodePoint [lookahead != `}`] is the sequence consisting of the code unit 0x0075 (LATIN SMALL LETTER U) followed by the code unit 0x007B (LEFT CURLY BRACKET) followed by the code units of the TRV of |CodePoint|. + The TRV of NotEscapeSequence :: `u` `{` CodePoint [lookahead <! HexDigit] [lookahead != `}`] is the sequence consisting of the code unit 0x0075 (LATIN SMALL LETTER U) followed by the code unit 0x007B (LEFT CURLY BRACKET) followed by the code units of the TRV of |CodePoint|.
  • The TRV of DecimalDigit :: one of `0` `1` `2` `3` `4` `5` `6` `7` `8` `9` is the SV of the |SourceCharacter| that is that single code point. From c564154d815f91219c86a6e980a833941c33b5f1 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 4 Jan 2018 12:52:11 -0500 Subject: [PATCH 02/48] Editorial: insert missing --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index d12527a396..c0c834cd56 100644 --- a/spec.html +++ b/spec.html @@ -26778,7 +26778,7 @@

    Week Day

    LocalTimeZoneAdjustment ( _t_, _isUTC_ )

    LocalTimeZoneAdjustment( _t_, _isUTC_ ) is an implementation-defined algorthm that must return a number representing milliseconds suitable for adding to a Time Value. The local political rules for standard time and daylight saving time in effect at _t_ should be used to determine the result in the way specified in the following three paragraphs.

    When _isUTC_ is true, LocalTZA( _t_, true ) should return the offset of the local time zone from UTC measured in milliseconds at time represented by time value _t_ (UTC). When the result is added to _t_ (UTC), it should yield the local time.

    -

    When _isUTC_ is false, LocalTZA( _t_, false ) should return the offset of the local time zone from UTC measured in milliseconds at local time represented by time value _t_local = _t_. When the result is subtracted from the local time _t_local, it should yield the corresponding UTC.

    +

    When _isUTC_ is false, LocalTZA( _t_, false ) should return the offset of the local time zone from UTC measured in milliseconds at local time represented by time value _t_local = _t_. When the result is subtracted from the local time _t_local, it should yield the corresponding UTC.

    When _t_local represents local time repeating multiple times at a negative time zone transition (e.g. when the daylight saving time ends or the time zone adjustment is decreased due to a time zone rule change) or skipped local time at a positive time zone transitions (e.g. when the daylight saving time starts or the time zone adjustment is increased due to a time zone rule change), _t_local must be interpreted with the time zone adjustment before the transition.

    If an implementation does not support a conversion described above or if political rules for time _t_ are not available within the implementation, the result must be 0.

    From dbf775128d390a157731d76220d6b044d9aff91c Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 4 Jan 2018 12:55:37 -0500 Subject: [PATCH 03/48] Editorial: delete extraneous dot --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index c0c834cd56..74c6ee4c5c 100644 --- a/spec.html +++ b/spec.html @@ -26784,7 +26784,7 @@

    LocalTimeZoneAdjustment ( _t_, _isUTC_ )

    It is recommended that implementations use the time zone information of the IANA Time Zone Database https://www.iana.org/time-zones/.

    1:30 AM on November 5, 2017 in America/New_York is repeated twice (fall backward), but it must be interpreted as 1:30 AM UTC-04 instead of 1:30 AM UTC-05. LocalTZA(TimeClip(MakeDate(MakeDay(2017, 10, 5), MakeTime(1, 30, 0, 0))), false) is -4 × msPerHour.

    -

    2:30 AM on March 12, 2017 in America/New_York does not exist, but it must be interpreted as 2:30 AM UTC-05 (equivalent to 3:30 AM UTC-04). LocalTZA(TimeClip(MakeDate(MakeDay(2017, 2, 12), MakeTime(2, 30, 0, 0))), false) is -5 × msPerHour.

    . +

    2:30 AM on March 12, 2017 in America/New_York does not exist, but it must be interpreted as 2:30 AM UTC-05 (equivalent to 3:30 AM UTC-04). LocalTZA(TimeClip(MakeDate(MakeDay(2017, 2, 12), MakeTime(2, 30, 0, 0))), false) is -5 × msPerHour.

    From cf8c857aa7aceff5cb716da2804defd7b26b6429 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 4 Jan 2018 13:00:21 -0500 Subject: [PATCH 04/48] Editorial: delete extra spaces and add a dot ... in an algorithm step --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 74c6ee4c5c..1e8519b1c0 100644 --- a/spec.html +++ b/spec.html @@ -26805,7 +26805,7 @@

    LocalTime ( _t_ )

    UTC ( _t_ )

    The abstract operation UTC with argument _t_ converts _t_ from local time to UTC. It performs the following steps:

    - 1. Return _t_ - LocalTZA( _t_ , false) + 1. Return _t_ - LocalTZA(_t_, false).

    UTC(LocalTime(_t_)) is not necessarily always equal to _t_. LocalTime(UTC(_t_local)) is not necessarily always equal to _t_local, either.

    From d7f1c6cbed2514aef131576643a9d330c592746a Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 4 Jan 2018 13:03:14 -0500 Subject: [PATCH 05/48] Editorial: add '*' around 'true' and 'false' ... in algorithm steps. --- spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index 1e8519b1c0..dc52e43488 100644 --- a/spec.html +++ b/spec.html @@ -26793,7 +26793,7 @@

    LocalTimeZoneAdjustment ( _t_, _isUTC_ )

    LocalTime ( _t_ )

    The abstract operation LocalTime with argument _t_ converts _t_ from UTC to local time by performing the following steps:

    - 1. Return _t_ + LocalTZA(_t_, true). + 1. Return _t_ + LocalTZA(_t_, *true*).

    Two different time values (_t_ (UTC)) are converted to the same local time tlocal at a negative time zone transition when there are repeated times (e.g. the daylight saving time ends or the time zone adjustment is decreased.).

    @@ -26805,7 +26805,7 @@

    LocalTime ( _t_ )

    UTC ( _t_ )

    The abstract operation UTC with argument _t_ converts _t_ from local time to UTC. It performs the following steps:

    - 1. Return _t_ - LocalTZA(_t_, false). + 1. Return _t_ - LocalTZA(_t_, *false*).

    UTC(LocalTime(_t_)) is not necessarily always equal to _t_. LocalTime(UTC(_t_local)) is not necessarily always equal to _t_local, either.

    @@ -27982,7 +27982,7 @@

    Runtime Semantics: TimeZoneString( _tv_ )

    1. Assert: Type(_tv_) is Number. 1. Assert: _tv_ is not *NaN*. - 1. Let _offset_ be LocalTZA(_tv_, true). + 1. Let _offset_ be LocalTZA(_tv_, *true*). 1. If _offset_ ≥ 0, let _offsetSign_ be `"+"`; otherwise, let _offsetSign_ be `"-"`. 1. Let _offsetMin_ be the String representation of MinFromTime(abs(_offset_)), formatted as a two-digit number, padded to the left with a zero if necessary. 1. Let _offsetHour_ be the String representation of HourFromTime(abs(_offset_)), formatted as a two-digit number, padded to the left with a zero if necessary. From 12dc5708b3f6877fd0c4e489c1b509a812efdd53 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 4 Jan 2018 13:14:20 -0500 Subject: [PATCH 06/48] Editorial: fix typo "algorthm" --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index dc52e43488..eea78de238 100644 --- a/spec.html +++ b/spec.html @@ -26776,7 +26776,7 @@

    Week Day

    LocalTimeZoneAdjustment ( _t_, _isUTC_ )

    -

    LocalTimeZoneAdjustment( _t_, _isUTC_ ) is an implementation-defined algorthm that must return a number representing milliseconds suitable for adding to a Time Value. The local political rules for standard time and daylight saving time in effect at _t_ should be used to determine the result in the way specified in the following three paragraphs.

    +

    LocalTimeZoneAdjustment( _t_, _isUTC_ ) is an implementation-defined algorithm that must return a number representing milliseconds suitable for adding to a Time Value. The local political rules for standard time and daylight saving time in effect at _t_ should be used to determine the result in the way specified in the following three paragraphs.

    When _isUTC_ is true, LocalTZA( _t_, true ) should return the offset of the local time zone from UTC measured in milliseconds at time represented by time value _t_ (UTC). When the result is added to _t_ (UTC), it should yield the local time.

    When _isUTC_ is false, LocalTZA( _t_, false ) should return the offset of the local time zone from UTC measured in milliseconds at local time represented by time value _t_local = _t_. When the result is subtracted from the local time _t_local, it should yield the corresponding UTC.

    When _t_local represents local time repeating multiple times at a negative time zone transition (e.g. when the daylight saving time ends or the time zone adjustment is decreased due to a time zone rule change) or skipped local time at a positive time zone transitions (e.g. when the daylight saving time starts or the time zone adjustment is increased due to a time zone rule change), _t_local must be interpreted with the time zone adjustment before the transition.

    From 0f1d570f6442b9055f833ff8ad02686603f9dd0b Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 4 Jan 2018 13:16:14 -0500 Subject: [PATCH 07/48] Editorial: resolve "LocalTimeZoneAdjustment" vs "LocalTZA" inconsistency (Could go either way. I chose to resolve it in the direction of smaller diff.) --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index eea78de238..60ac79f3c0 100644 --- a/spec.html +++ b/spec.html @@ -26775,8 +26775,8 @@

    Week Day

    -

    LocalTimeZoneAdjustment ( _t_, _isUTC_ )

    -

    LocalTimeZoneAdjustment( _t_, _isUTC_ ) is an implementation-defined algorithm that must return a number representing milliseconds suitable for adding to a Time Value. The local political rules for standard time and daylight saving time in effect at _t_ should be used to determine the result in the way specified in the following three paragraphs.

    +

    LocalTZA ( _t_, _isUTC_ )

    +

    LocalTZA( _t_, _isUTC_ ) is an implementation-defined algorithm that must return a number representing milliseconds suitable for adding to a Time Value. The local political rules for standard time and daylight saving time in effect at _t_ should be used to determine the result in the way specified in the following three paragraphs.

    When _isUTC_ is true, LocalTZA( _t_, true ) should return the offset of the local time zone from UTC measured in milliseconds at time represented by time value _t_ (UTC). When the result is added to _t_ (UTC), it should yield the local time.

    When _isUTC_ is false, LocalTZA( _t_, false ) should return the offset of the local time zone from UTC measured in milliseconds at local time represented by time value _t_local = _t_. When the result is subtracted from the local time _t_local, it should yield the corresponding UTC.

    When _t_local represents local time repeating multiple times at a negative time zone transition (e.g. when the daylight saving time ends or the time zone adjustment is decreased due to a time zone rule change) or skipped local time at a positive time zone transitions (e.g. when the daylight saving time starts or the time zone adjustment is increased due to a time zone rule change), _t_local must be interpreted with the time zone adjustment before the transition.

    From ec1cd8c775b922ebe0b76060964506fba887ff27 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 4 Jan 2018 22:21:05 -0500 Subject: [PATCH 08/48] Editorial: Remove '_' RHS for IdentifierPart ... because that RHS made it ambiguous. (Resolves issue #1059.) --- spec.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 60ac79f3c0..3408946cab 100644 --- a/spec.html +++ b/spec.html @@ -9826,7 +9826,6 @@

    Syntax

    IdentifierPart :: UnicodeIDContinue `$` - `_` `\` UnicodeEscapeSequence <ZWNJ> <ZWJ> @@ -9838,6 +9837,9 @@

    Syntax

    > any Unicode code point with the Unicode property “ID_Continue”

    The definitions of the nonterminal |UnicodeEscapeSequence| is given in .

    + +

    The nonterminal |IdentifierPart| derives `_` via |UnicodeIDContinue|.

    +

    The sets of code points with Unicode properties “ID_Start” and “ID_Continue” include, respectively, the code points with Unicode properties “Other_ID_Start” and “Other_ID_Continue”.

    From b4081da5e2cf2f98d030ef19cac83c0b9ff3ca2f Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Tue, 23 Jan 2018 21:42:42 -0500 Subject: [PATCH 09/48] Editorial: entity-encode < and > --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 3408946cab..a7b36f68dd 100644 --- a/spec.html +++ b/spec.html @@ -29174,7 +29174,7 @@

    Syntax

    `?` GroupName[?U] GroupName[U] :: - `<` RegExpIdentifierName[?U] `>` + `<` RegExpIdentifierName[?U] `>` RegExpIdentifierName[U] :: RegExpIdentifierStart[?U] From 0e04451352c16b4b21ad21a7e50a7074ee6dc80c Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Tue, 23 Jan 2018 21:54:58 -0500 Subject: [PATCH 10/48] Editorial: tweak some indentation --- spec.html | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/spec.html b/spec.html index a7b36f68dd..5b6d1602bb 100644 --- a/spec.html +++ b/spec.html @@ -30441,11 +30441,11 @@

    AtomEscape

    The production AtomEscape[U] :: [+N] `k` GroupName evaluates as follows:

    - 1. Search the enclosing RegExp for an instance of a |GroupSpecifier| for a |RegExpIdentifierName| which has a StringValue equal to the StringValue of the |RegExpIdentifierName| contained in |GroupName|. - 1. Assert: A unique such |GroupSpecifier| is found. - 1. Let _parenIndex_ be the number of left capturing parentheses in the entire regular expression that occur to the left of the located |GroupSpecifier|. This is the total number of times the Atom :: `(` GroupSpecifier Disjunction `)` production is expanded prior to that production's |Term| plus the total number of Atom :: `(` GroupSpecifier Disjunction `)` productions enclosing this |Term|. - 1. Call BackreferenceMatcher(_parenIndex_) and return its Matcher result. - + 1. Search the enclosing RegExp for an instance of a |GroupSpecifier| for a |RegExpIdentifierName| which has a StringValue equal to the StringValue of the |RegExpIdentifierName| contained in |GroupName|. + 1. Assert: A unique such |GroupSpecifier| is found. + 1. Let _parenIndex_ be the number of left capturing parentheses in the entire regular expression that occur to the left of the located |GroupSpecifier|. This is the total number of times the Atom :: `(` GroupSpecifier Disjunction `)` production is expanded prior to that production's |Term| plus the total number of Atom :: `(` GroupSpecifier Disjunction `)` productions enclosing this |Term|. + 1. Call BackreferenceMatcher(_parenIndex_) and return its Matcher result. + @@ -31339,18 +31339,18 @@

    Static Semantics: StringValue

    Runtime Semantics: BackreferenceMatcher Abstract Operation

    The abstract operation BackreferenceMatcher takes one argument, an integer _n_, and performs the following steps:

    - 1. Return an internal Matcher closure that takes two arguments, a State _x_ and a Continuation _c_, and performs the following steps: - 1. Let _cap_ be _x_'s _captures_ List. - 1. Let _s_ be _cap_[_n_]. - 1. If _s_ is *undefined*, return _c_(_x_). - 1. Let _e_ be _x_'s _endIndex_. - 1. Let _len_ be the number of elements in _s_. - 1. Let _f_ be _e_ + _direction_ × _len_. - 1. If _f_ < 0 or _f_ > _InputLength_, return ~failure~. - 1. Let _g_ be min(_e_, _f_). - 1. If there exists an integer _i_ between 0 (inclusive) and _len_ (exclusive) such that Canonicalize(_s_[_i_]) is not the same character value as Canonicalize(_Input_[_g_ + _i_]), return ~failure~. - 1. Let _y_ be the State (_f_, _cap_). - 1. Call _c_(_y_) and return its result. + 1. Return an internal Matcher closure that takes two arguments, a State _x_ and a Continuation _c_, and performs the following steps: + 1. Let _cap_ be _x_'s _captures_ List. + 1. Let _s_ be _cap_[_n_]. + 1. If _s_ is *undefined*, return _c_(_x_). + 1. Let _e_ be _x_'s _endIndex_. + 1. Let _len_ be the number of elements in _s_. + 1. Let _f_ be _e_ + _direction_ × _len_. + 1. If _f_ < 0 or _f_ > _InputLength_, return ~failure~. + 1. Let _g_ be min(_e_, _f_). + 1. If there exists an integer _i_ between 0 (inclusive) and _len_ (exclusive) such that Canonicalize(_s_[_i_]) is not the same character value as Canonicalize(_Input_[_g_ + _i_]), return ~failure~. + 1. Let _y_ be the State (_f_, _cap_). + 1. Call _c_(_y_) and return its result. From 342fdb0f1225383842f865c1ca69bdab7ded331f Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Tue, 23 Jan 2018 23:54:47 -0500 Subject: [PATCH 11/48] Editorial: consistify grammar params in defining prodns --- spec.html | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/spec.html b/spec.html index 5b6d1602bb..e82b84ef76 100644 --- a/spec.html +++ b/spec.html @@ -29096,31 +29096,31 @@

    Patterns

    The `RegExp` constructor applies the following grammar to the input pattern String. An error occurs if the grammar cannot interpret the String as an expansion of |Pattern|.

    Syntax

    - Pattern[U] :: - Disjunction[?U] + Pattern[U, N] :: + Disjunction[?U, ?N] - Disjunction[U] :: - Alternative[?U] - Alternative[?U] `|` Disjunction[?U] + Disjunction[U, N] :: + Alternative[?U, ?N] + Alternative[?U, ?N] `|` Disjunction[?U, ?N] - Alternative[U] :: + Alternative[U, N] :: [empty] - Alternative[?U] Term[?U] + Alternative[?U, ?N] Term[?U, ?N] - Term[U] :: - Assertion[?U] - Atom[?U] - Atom[?U] Quantifier + Term[U, N] :: + Assertion[?U, ?N] + Atom[?U, ?N] + Atom[?U, ?N] Quantifier - Assertion[U] :: + Assertion[U, N] :: `^` `$` `\` `b` `\` `B` - `(` `?` `=` Disjunction[?U] `)` - `(` `?` `!` Disjunction[?U] `)` - `(` `?` `<=` Disjunction[?U] `)` - `(` `?` `<!` Disjunction[?U] `)` + `(` `?` `=` Disjunction[?U, ?N] `)` + `(` `?` `!` Disjunction[?U, ?N] `)` + `(` `?` `<=` Disjunction[?U, ?N] `)` + `(` `?` `<!` Disjunction[?U, ?N] `)` Quantifier :: QuantifierPrefix @@ -29138,8 +29138,8 @@

    Syntax

    PatternCharacter `.` `\` AtomEscape[?U, ?N] - CharacterClass[?U, ?N] - `(` GroupSpecifier Disjunction[?U, ?N] `)` + CharacterClass[?U] + `(` GroupSpecifier[?U] Disjunction[?U, ?N] `)` `(` `?` `:` Disjunction[?U, ?N] `)` SyntaxCharacter :: one of @@ -39451,7 +39451,7 @@

    Syntax

    [+U] Assertion[+U, ?N] [+U] Atom[+U, ?N] [+U] Atom[+U, ?N] Quantifier - [~U] QuantifiableAssertion Quantifier + [~U] QuantifiableAssertion[?N] Quantifier [~U] Assertion[~U, ?N] [~U] ExtendedAtom[?N] Quantifier [~U] ExtendedAtom[?N] @@ -39463,7 +39463,7 @@

    Syntax

    `\` `B` [+U] `(` `?` `=` Disjunction[+U, ?N] `)` [+U] `(` `?` `!` Disjunction[+U, ?N] `)` - [~U] QuantifiableAssertion[N] + [~U] QuantifiableAssertion[?N] QuantifiableAssertion[N] :: `(` `?` `=` Disjunction[~U, ?N] `)` @@ -39473,7 +39473,7 @@

    Syntax

    `.` `\` AtomEscape[~U, ?N] `\` [lookahead == `c`] - CharacterClass[~U, ?N] + CharacterClass[~U] `(` Disjunction[~U, ?N] `)` `(` `?` `:` Disjunction[~U, ?N] `)` InvalidBracedQuantifier @@ -39492,7 +39492,7 @@

    Syntax

    [~U] DecimalEscape [> but only if the CapturingGroupNumber of |DecimalEscape| is <= _NcapturingParens_] CharacterClassEscape CharacterEscape[~U, ?N] - [+N] `k` GroupName + [+N] `k` GroupName[?U] CharacterEscape[U, N] :: ControlEscape From 3c8d7fc9eb51f94bc0bc95fceabf12ceb461447f Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Wed, 24 Jan 2018 00:00:09 -0500 Subject: [PATCH 12/48] Editorial: elide unnecessary grammar params in non-defining prodns --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index e82b84ef76..242aad7ac2 100644 --- a/spec.html +++ b/spec.html @@ -29318,7 +29318,7 @@

    Static Semantics: Early Errors

    It is a Syntax Error if the MV of the first |DecimalDigits| is larger than the MV of the second |DecimalDigits|.
  • - AtomEscape[U] :: [+N] `k` GroupName + AtomEscape :: `k` GroupName