1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:47:45 +00:00

LibJS: Rename TimeZoneNumericUTCOffsetNotAmbiguous

This is an editorial change in the Temporal spec.

See: 5ebd34b
This commit is contained in:
Linus Groh 2022-07-05 19:51:00 +02:00
parent 7ef3b42685
commit 8dcd0d4a06
2 changed files with 9 additions and 9 deletions

View file

@ -765,10 +765,10 @@ bool ISO8601Parser::parse_time_zone_utc_offset()
|| parse_utc_designator(); || parse_utc_designator();
} }
// https://tc39.es/proposal-temporal/#prod-TimeZoneNumericUTCOffsetNotAmbiguous // https://tc39.es/proposal-temporal/#prod-TimeZoneNumericUTCOffsetNotAmbiguousWithDayOfMonth
bool ISO8601Parser::parse_time_zone_numeric_utc_offset_not_ambiguous() bool ISO8601Parser::parse_time_zone_numeric_utc_offset_not_ambiguous_with_day_of_month()
{ {
// TimeZoneNumericUTCOffsetNotAmbiguous : // TimeZoneNumericUTCOffsetNotAmbiguousWithDayOfMonth :
// TimeZoneNumericUTCOffset but not - TimeZoneUTCOffsetHour // TimeZoneNumericUTCOffset but not - TimeZoneUTCOffsetHour
StateTransaction transaction { *this }; StateTransaction transaction { *this };
if (!parse_time_zone_numeric_utc_offset()) if (!parse_time_zone_numeric_utc_offset())
@ -784,10 +784,10 @@ bool ISO8601Parser::parse_time_zone_numeric_utc_offset_not_ambiguous()
bool ISO8601Parser::parse_time_zone_numeric_utc_offset_not_ambiguous_allowed_negative_hour() bool ISO8601Parser::parse_time_zone_numeric_utc_offset_not_ambiguous_allowed_negative_hour()
{ {
// TimeZoneNumericUTCOffsetNotAmbiguousAllowedNegativeHour : // TimeZoneNumericUTCOffsetNotAmbiguousAllowedNegativeHour :
// TimeZoneNumericUTCOffsetNotAmbiguous // TimeZoneNumericUTCOffsetNotAmbiguousWithDayOfMonth
// - TimeHourNotValidMonth // - TimeHourNotValidMonth
StateTransaction transaction { *this }; StateTransaction transaction { *this };
if (!parse_time_zone_numeric_utc_offset_not_ambiguous()) { if (!parse_time_zone_numeric_utc_offset_not_ambiguous_with_day_of_month()) {
if (!m_state.lexer.consume_specific('-')) if (!m_state.lexer.consume_specific('-'))
return false; return false;
if (!parse_time_hour_not_valid_month()) if (!parse_time_hour_not_valid_month())
@ -1108,7 +1108,7 @@ bool ISO8601Parser::parse_time_hour_minute_basic_format_not_ambiguous()
bool ISO8601Parser::parse_time_spec_with_optional_time_zone_not_ambiguous() bool ISO8601Parser::parse_time_spec_with_optional_time_zone_not_ambiguous()
{ {
// TimeSpecWithOptionalTimeZoneNotAmbiguous : // TimeSpecWithOptionalTimeZoneNotAmbiguous :
// TimeHour TimeZoneNumericUTCOffsetNotAmbiguous[opt] TimeZoneBracketedAnnotation[opt] // TimeHour TimeZoneNumericUTCOffsetNotAmbiguousWithDayOfMonth[opt] TimeZoneBracketedAnnotation[opt]
// TimeHourNotValidMonth TimeZone // TimeHourNotValidMonth TimeZone
// TimeHour : TimeMinute TimeZone[opt] // TimeHour : TimeMinute TimeZone[opt]
// TimeHourMinuteBasicFormatNotAmbiguous TimeZoneBracketedAnnotation[opt] // TimeHourMinuteBasicFormatNotAmbiguous TimeZoneBracketedAnnotation[opt]
@ -1116,7 +1116,7 @@ bool ISO8601Parser::parse_time_spec_with_optional_time_zone_not_ambiguous()
// TimeHour : TimeMinute : TimeSecond TimeFraction[opt] TimeZone[opt] // TimeHour : TimeMinute : TimeSecond TimeFraction[opt] TimeZone[opt]
// TimeHour TimeMinute TimeSecondNotValidMonth TimeZone[opt] // TimeHour TimeMinute TimeSecondNotValidMonth TimeZone[opt]
// TimeHour TimeMinute TimeSecond TimeFraction TimeZone[opt] // TimeHour TimeMinute TimeSecond TimeFraction TimeZone[opt]
// NOTE: Reverse order here because `TimeHour TimeZoneNumericUTCOffsetNotAmbiguous[opt] TimeZoneBracketedAnnotation[opt]` can // NOTE: Reverse order here because `TimeHour TimeZoneNumericUTCOffsetNotAmbiguousWithDayOfMonth[opt] TimeZoneBracketedAnnotation[opt]` can
// be a subset of `TimeHourNotValidMonth TimeZone`, so we'd not attempt to parse that but may not exhaust the input string. // be a subset of `TimeHourNotValidMonth TimeZone`, so we'd not attempt to parse that but may not exhaust the input string.
{ {
StateTransaction transaction { *this }; StateTransaction transaction { *this };
@ -1163,7 +1163,7 @@ bool ISO8601Parser::parse_time_spec_with_optional_time_zone_not_ambiguous()
return true; return true;
} }
} else { } else {
(void)parse_time_zone_numeric_utc_offset_not_ambiguous(); (void)parse_time_zone_numeric_utc_offset_not_ambiguous_with_day_of_month();
(void)parse_time_zone_bracketed_annotation(); (void)parse_time_zone_bracketed_annotation();
transaction.commit(); transaction.commit();
return true; return true;

View file

@ -129,7 +129,7 @@ public:
[[nodiscard]] bool parse_time_zone_utc_offset_fraction(); [[nodiscard]] bool parse_time_zone_utc_offset_fraction();
[[nodiscard]] bool parse_time_zone_numeric_utc_offset(); [[nodiscard]] bool parse_time_zone_numeric_utc_offset();
[[nodiscard]] bool parse_time_zone_utc_offset(); [[nodiscard]] bool parse_time_zone_utc_offset();
[[nodiscard]] bool parse_time_zone_numeric_utc_offset_not_ambiguous(); [[nodiscard]] bool parse_time_zone_numeric_utc_offset_not_ambiguous_with_day_of_month();
[[nodiscard]] bool parse_time_zone_numeric_utc_offset_not_ambiguous_allowed_negative_hour(); [[nodiscard]] bool parse_time_zone_numeric_utc_offset_not_ambiguous_allowed_negative_hour();
[[nodiscard]] bool parse_time_zone_utc_offset_name(); [[nodiscard]] bool parse_time_zone_utc_offset_name();
[[nodiscard]] bool parse_tz_leading_char(); [[nodiscard]] bool parse_tz_leading_char();