Commit graph

39 commits

Author SHA1 Message Date
Luke Wilde
588dae8aa6 LibJS/Temporal: Allow annotations after YYYY-MM and MM-DD
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/160e836
2023-02-11 18:42:32 +00:00
Luke Wilde
192aa75279 LibJS: Align ISO 8601 grammar with annotations from IXDTF
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/c64b844
2022-11-03 19:15:50 +00:00
Idan Horowitz
d38aeddd77 LibJS: Simplify ParseTemporalTimeZoneString
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/eec8efab
2022-10-20 00:47:42 +02:00
Moustafa Raafat
d758566996 LibJS: Simplify ResolveISOMonth
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/1b83226
2022-10-19 22:39:33 +02:00
Linus Groh
4567ded8e4 LibJS: Reject relativeTo string such as "2022-08-18T17:01Z"
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/2dc20bf
2022-10-17 12:56:05 +02:00
Linus Groh
b6f101f1c0 LibJS: Fix TemporalCalendarString ambiguity
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/278d238
- https://github.com/tc39/proposal-temporal/commit/b73aea7
2022-10-16 15:20:23 +02:00
Linus Groh
2cf5f5c278 LibJS: Remove unused nonterminals from the ISO8601 parser
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/fe9ef00
2022-08-25 23:41:09 +01:00
Linus Groh
42452a81a2 LibJS: Simplify TimeSpecWithOptionalTimeZoneNotAmbiguous
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/77b0163
2022-08-25 23:41:09 +01:00
Linus Groh
6850f25840 LibJS: Support IANA legacy names in the Temporal ISO 8601 grammar
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/2419680
2022-07-30 10:50:50 +01:00
Linus Groh
8733fbae76 LibJS: Rename TimeHourMinuteBasicFormatNotAmbiguous
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/70de75b
2022-07-05 23:15:52 +02:00
Linus Groh
e1a6418015 LibJS: Rename TimeZoneNumericUTCOffsetNotAmbiguousAllowedNegative
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/9ddd57e
2022-07-05 23:15:52 +02:00
Linus Groh
8dcd0d4a06 LibJS: Rename TimeZoneNumericUTCOffsetNotAmbiguous
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/5ebd34b
2022-07-05 23:15:52 +02:00
Linus Groh
3720f4bd8f LibJS: Fix production for time zone name in time zone strings
This is a normative change in the Temporal spec.

See:
- https://github.com/tc39/proposal-temporal/commit/caf013a
- https://github.com/tc39/proposal-temporal/commit/fb7cfa6
2022-06-29 07:35:42 +01:00
Linus Groh
3bb94dd62e LibJS: Refactor Temporal parse AOs
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/7fe29eb
2022-06-10 12:39:11 +02:00
Linus Groh
0946f82c8c LibJS: Combine TemporalTimeZoneIdentifier and TimeZoneBracketedName
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6db76f4
2022-05-17 21:14:01 +01:00
Linus Groh
03017be5bd LibJS: Remove redundant TemporalRelativeToString production
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/f85f953
2022-05-16 20:29:32 +01:00
Linus Groh
51e01b5a80 LibJS: Remove redundant TemporalDateString production
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/41a8a5c
2022-05-16 20:28:26 +01:00
Linus Groh
b020b8eea2 LibJS: Handle Etc/GMT timezones properly in TimeZone{IANA,Bracketed}Name
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/8c73780
2022-03-31 17:09:10 +01:00
Linus Groh
0e3def1d0b LibJS: Don't parse/re-format offset in parse_temporal_time_zone_string()
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/6abe146
2022-01-23 00:22:10 +00:00
Linus Groh
3bd7f5b89e LibJS: Fully parse the TimeZoneIANAName production
Currently does nothing as we'll declare everything other than UTC as
invalid, but it's a first step towards supporting named time zones :^)
2022-01-06 22:40:09 +01:00
Linus Groh
3ab1c52e2b LibJS: Require 'T' prefix for ambiguous time-only strings
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/514ede3
2021-12-24 00:07:52 +01:00
Linus Groh
f7fe7f8c77 LibJS: Capture TimeFraction parse result instead of Fraction
Not much of a difference as TimeFraction just parses Fraction, but let's
do it correctly. Small mistake I did in 4b7f716.

Thanks to YouTube user gla3dr for noticing this :^)
2021-12-19 09:29:46 +00:00
Linus Groh
01eefc344a LibJS: Disallow date-only strings for PlainTime
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/b16a296
2021-12-18 22:32:39 +00:00
Linus Groh
6da6da73cc LibJS: Allow 'T' prefix in time-only strings
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/f5e8edf
2021-12-18 22:32:39 +00:00
Linus Groh
6d5e95d621 LibJS: Add optional calendar to Plain{Time,YearMonth,MonthDay} prod
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/7e58ba3
2021-12-18 22:32:39 +00:00
Linus Groh
4b7f716f21 LibJS: Fix ambiguity in FractionalPart grammar
This is a normative change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/0f11bd6
2021-12-18 22:32:39 +00:00
Linus Groh
f7ba81ac52 LibJS: Implement parsing of TemporalDurationString 2021-11-28 10:32:28 +00:00
Linus Groh
783222f87a LibJS: Implement parsing of TemporalInstantString 2021-11-20 23:10:09 +00:00
Linus Groh
79a18b058f LibJS: Implement parsing of TemporalCalendarString 2021-11-20 23:10:09 +00:00
Linus Groh
1583c7257c LibJS: Implement parsing of TemporalRelativeToString 2021-11-20 23:10:09 +00:00
Linus Groh
98b876ad3f LibJS: Implement parsing of TemporalZonedDateTimeString 2021-11-20 23:10:09 +00:00
Linus Groh
3b1de431cc LibJS: Implement parsing of TemporalYearMonthString 2021-11-20 23:10:09 +00:00
Linus Groh
3ddab2f4fe LibJS: Implement parsing of TemporalMonthDayString 2021-11-20 23:10:09 +00:00
Linus Groh
453c78215c LibJS: Implement parsing of TemporalTimeString 2021-11-20 23:10:09 +00:00
Linus Groh
b42b7d5f16 LibJS: Implement parsing of TemporalDateTimeString 2021-11-20 23:10:09 +00:00
Linus Groh
02e7de2cba LibJS: Implement parsing of TemporalDateString 2021-11-20 23:10:09 +00:00
Linus Groh
de23f0b68c LibJS: Start fleshing out an ISO 8601 parser for Temporal
This is the start of a parser for the ISO 8601 grammar used in the
Temporal spec:
https://tc39.es/proposal-temporal/#sec-temporal-iso8601grammar

We will, on purpose, not use a generic ISO 8601 parser from AK or
similar for two reasons:

- Many AOs make specific assumptions about which productions exist and
  access them directly, even when they're part of a larger production.
- The spec says "The grammar deviates from the standard given in ISO
  8601 in the following ways:" and then lists 17 of such deviations.
  Making that work with a general purpose parser is not worth it.

The public API is not being used anywhere yet, but will be in the next
couple of commits. Likewise, the Production enum will be populated with
all the productions accessed directly (e.g. TemporalDateString).

Many thanks to Ali for showing me how to improve my initial approach
full of macros with a nice RAII helper - it's much nicer :^)

Co-Authored-By: Ali Mohammad Pur <mpfard@serenityos.org>
2021-11-20 23:10:09 +00:00
Idan Horowitz
141c46feda AK: Add a DateTimeLexer
This is an AK::GenericLexer that exposes helper methods for parsing
date and time related literals (years, months, days, hours, minutes,
seconds, fractional seconds & more)
2021-07-12 19:05:17 +01:00
Linus Groh
265e89367e LibJS: Start implementing Temporal.TimeZone
Here we got our first Temporal object :^)
This patch adds the TimeZone object itself, its constructor and
prototype (currently empty), and a bunch of required abstract operations
2021-07-07 00:42:01 +01:00