mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:17:45 +00:00
LibJS: Align ISO 8601 grammar with annotations from IXDTF
This is a normative change in the Temporal spec.
See: c64b844
This commit is contained in:
parent
0f2b4d0aac
commit
192aa75279
6 changed files with 245 additions and 93 deletions
|
@ -13,6 +13,12 @@
|
|||
|
||||
namespace JS::Temporal {
|
||||
|
||||
struct Annotation {
|
||||
bool critical { false };
|
||||
StringView key;
|
||||
StringView value;
|
||||
};
|
||||
|
||||
struct ParseResult {
|
||||
Optional<StringView> sign;
|
||||
Optional<StringView> date_year;
|
||||
|
@ -22,7 +28,6 @@ struct ParseResult {
|
|||
Optional<StringView> time_minute;
|
||||
Optional<StringView> time_second;
|
||||
Optional<StringView> time_fraction;
|
||||
Optional<StringView> calendar_name;
|
||||
Optional<StringView> utc_designator;
|
||||
Optional<StringView> time_zone_bracketed_annotation;
|
||||
Optional<StringView> time_zone_numeric_utc_offset;
|
||||
|
@ -42,6 +47,9 @@ struct ParseResult {
|
|||
Optional<StringView> duration_minutes_fraction;
|
||||
Optional<StringView> duration_whole_seconds;
|
||||
Optional<StringView> duration_seconds_fraction;
|
||||
Optional<StringView> annotation_key;
|
||||
Optional<StringView> annotation_value;
|
||||
Vector<Annotation> annotations;
|
||||
};
|
||||
|
||||
enum class Production {
|
||||
|
@ -54,7 +62,7 @@ enum class Production {
|
|||
TemporalZonedDateTimeString,
|
||||
TimeZoneIdentifier,
|
||||
TimeZoneNumericUTCOffset,
|
||||
CalendarName,
|
||||
AnnotationValue,
|
||||
DateMonth,
|
||||
};
|
||||
|
||||
|
@ -97,6 +105,7 @@ public:
|
|||
[[nodiscard]] bool parse_weeks_designator();
|
||||
[[nodiscard]] bool parse_years_designator();
|
||||
[[nodiscard]] bool parse_utc_designator();
|
||||
[[nodiscard]] bool parse_annotation_critical_flag();
|
||||
[[nodiscard]] bool parse_date_year();
|
||||
[[nodiscard]] bool parse_date_month();
|
||||
[[nodiscard]] bool parse_date_month_with_thirty_days();
|
||||
|
@ -131,15 +140,23 @@ public:
|
|||
[[nodiscard]] bool parse_time_zone_offset_required();
|
||||
[[nodiscard]] bool parse_time_zone_name_required();
|
||||
[[nodiscard]] bool parse_time_zone();
|
||||
[[nodiscard]] bool parse_calendar_name();
|
||||
[[nodiscard]] bool parse_calendar();
|
||||
[[nodiscard]] bool parse_a_key_leading_char();
|
||||
[[nodiscard]] bool parse_a_key_char();
|
||||
[[nodiscard]] bool parse_a_val_char();
|
||||
[[nodiscard]] bool parse_annotation_key_tail();
|
||||
[[nodiscard]] bool parse_annotation_key();
|
||||
[[nodiscard]] bool parse_annotation_value_component();
|
||||
[[nodiscard]] bool parse_annotation_value_tail();
|
||||
[[nodiscard]] bool parse_annotation_value();
|
||||
[[nodiscard]] bool parse_annotation();
|
||||
[[nodiscard]] bool parse_annotations();
|
||||
[[nodiscard]] bool parse_time_spec();
|
||||
[[nodiscard]] bool parse_time_spec_with_optional_time_zone_not_ambiguous();
|
||||
[[nodiscard]] bool parse_time_spec_separator();
|
||||
[[nodiscard]] bool parse_date_time();
|
||||
[[nodiscard]] bool parse_calendar_time();
|
||||
[[nodiscard]] bool parse_calendar_date_time();
|
||||
[[nodiscard]] bool parse_calendar_date_time_time_required();
|
||||
[[nodiscard]] bool parse_annotated_time();
|
||||
[[nodiscard]] bool parse_annotated_date_time();
|
||||
[[nodiscard]] bool parse_annotated_date_time_time_required();
|
||||
[[nodiscard]] bool parse_duration_whole_seconds();
|
||||
[[nodiscard]] bool parse_duration_seconds_fraction();
|
||||
[[nodiscard]] bool parse_duration_seconds_part();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue