From ce4a1f3c3b16850aa0558e945330e738435cc235 Mon Sep 17 00:00:00 2001 From: Perry Thompson Date: Sat, 3 Oct 2020 16:23:42 -0500 Subject: [PATCH] Add support for RFC2822 --- lib/DateTime/Parse.pm6 | 43 +++++++++++++++++++++++++++++++++++++++++- t/01-basic.t | 5 +++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/lib/DateTime/Parse.pm6 b/lib/DateTime/Parse.pm6 index 307fdf0..7536c20 100644 --- a/lib/DateTime/Parse.pm6 +++ b/lib/DateTime/Parse.pm6 @@ -6,7 +6,13 @@ my class X::DateTime::CannotParse is Exception { class DateTime::Parse is DateTime { grammar DateTime::Parse::Grammar { token TOP { - | | | | | + | + | + | + | + | + | + | } token rfc3339-date { @@ -21,6 +27,10 @@ class DateTime::Parse is DateTime { } + token time3 { + <.SP> + } + token partial-time { ':' ':' ? } @@ -33,6 +43,10 @@ class DateTime::Parse is DateTime { [ 'Z' | 'z' | ] } + token time-offset2 { + + } + token time-numoffset { ':' } @@ -53,6 +67,10 @@ class DateTime::Parse is DateTime { <.wkday> ',' <.SP> <.SP>