Commit graph

16 commits

Author SHA1 Message Date
Linus Groh
f1dafabbb9 LibJS: Simplify TemporalInstantString
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/271d71c
2021-12-08 19:57:19 +00:00
Linus Groh
f7ba81ac52 LibJS: Implement parsing of TemporalDurationString 2021-11-28 10:32:28 +00:00
Linus Groh
908d943e85 LibJS: Parse TemporalInstantString as part of TemporalCalendarString 2021-11-27 23:54:38 +00:00
Linus Groh
ad294ff2ee LibJS: Simplify TemporalRelativeToString
This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/d3b2e90
2021-11-24 18:18:05 +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