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

LibJS: Combine TemporalTimeZoneIdentifier and TimeZoneBracketedName

This is an editorial change in the Temporal spec.

See: 6db76f4
This commit is contained in:
Linus Groh 2022-05-17 21:14:01 +01:00
parent 9b4aabbcf9
commit 0946f82c8c
2 changed files with 8 additions and 19 deletions

View file

@ -950,10 +950,10 @@ bool ISO8601Parser::parse_time_zone_iana_name()
return true; return true;
} }
// https://tc39.es/proposal-temporal/#prod-TimeZoneBracketedName // https://tc39.es/proposal-temporal/#prod-TimeZoneIdentifier
bool ISO8601Parser::parse_time_zone_bracketed_name() bool ISO8601Parser::parse_time_zone_identifier()
{ {
// TimeZoneBracketedName : // TimeZoneIdentifier :
// TimeZoneIANAName // TimeZoneIANAName
// TimeZoneUTCOffsetName // TimeZoneUTCOffsetName
StateTransaction transaction { *this }; StateTransaction transaction { *this };
@ -970,11 +970,11 @@ bool ISO8601Parser::parse_time_zone_bracketed_name()
bool ISO8601Parser::parse_time_zone_bracketed_annotation() bool ISO8601Parser::parse_time_zone_bracketed_annotation()
{ {
// TimeZoneBracketedAnnotation : // TimeZoneBracketedAnnotation :
// [ TimeZoneBracketedName ] // [ TimeZoneIdentifier ]
StateTransaction transaction { *this }; StateTransaction transaction { *this };
if (!m_state.lexer.consume_specific('[')) if (!m_state.lexer.consume_specific('['))
return false; return false;
if (!parse_time_zone_bracketed_name()) if (!parse_time_zone_identifier())
return false; return false;
if (!m_state.lexer.consume_specific(']')) if (!m_state.lexer.consume_specific(']'))
return false; return false;
@ -1650,24 +1650,14 @@ bool ISO8601Parser::parse_temporal_time_string()
|| parse_calendar_time(); || parse_calendar_time();
} }
// https://tc39.es/proposal-temporal/#prod-TemporalTimeZoneIdentifier
bool ISO8601Parser::parse_temporal_time_zone_identifier()
{
// TemporalTimeZoneIdentifier :
// TimeZoneNumericUTCOffset
// TimeZoneIANAName
return parse_time_zone_numeric_utc_offset()
|| parse_time_zone_iana_name();
}
// https://tc39.es/proposal-temporal/#prod-TemporalTimeZoneString // https://tc39.es/proposal-temporal/#prod-TemporalTimeZoneString
bool ISO8601Parser::parse_temporal_time_zone_string() bool ISO8601Parser::parse_temporal_time_zone_string()
{ {
// TemporalTimeZoneString : // TemporalTimeZoneString :
// TemporalTimeZoneIdentifier // TimeZoneIdentifier
// Date TimeSpecSeparator[opt] TimeZone Calendar[opt] // Date TimeSpecSeparator[opt] TimeZone Calendar[opt]
StateTransaction transaction { *this }; StateTransaction transaction { *this };
if (!parse_temporal_time_zone_identifier()) { if (!parse_time_zone_identifier()) {
if (!parse_date()) if (!parse_date())
return false; return false;
(void)parse_time_spec_separator(); (void)parse_time_spec_separator();

View file

@ -136,7 +136,7 @@ public:
[[nodiscard]] bool parse_time_zone_iana_component(); [[nodiscard]] bool parse_time_zone_iana_component();
[[nodiscard]] bool parse_time_zone_iana_name_tail(); [[nodiscard]] bool parse_time_zone_iana_name_tail();
[[nodiscard]] bool parse_time_zone_iana_name(); [[nodiscard]] bool parse_time_zone_iana_name();
[[nodiscard]] bool parse_time_zone_bracketed_name(); [[nodiscard]] bool parse_time_zone_identifier();
[[nodiscard]] bool parse_time_zone_bracketed_annotation(); [[nodiscard]] bool parse_time_zone_bracketed_annotation();
[[nodiscard]] bool parse_time_zone_offset_required(); [[nodiscard]] bool parse_time_zone_offset_required();
[[nodiscard]] bool parse_time_zone_name_required(); [[nodiscard]] bool parse_time_zone_name_required();
@ -176,7 +176,6 @@ public:
[[nodiscard]] bool parse_temporal_duration_string(); [[nodiscard]] bool parse_temporal_duration_string();
[[nodiscard]] bool parse_temporal_month_day_string(); [[nodiscard]] bool parse_temporal_month_day_string();
[[nodiscard]] bool parse_temporal_time_string(); [[nodiscard]] bool parse_temporal_time_string();
[[nodiscard]] bool parse_temporal_time_zone_identifier();
[[nodiscard]] bool parse_temporal_time_zone_string(); [[nodiscard]] bool parse_temporal_time_zone_string();
[[nodiscard]] bool parse_temporal_year_month_string(); [[nodiscard]] bool parse_temporal_year_month_string();
[[nodiscard]] bool parse_temporal_zoned_date_time_string(); [[nodiscard]] bool parse_temporal_zoned_date_time_string();