From 1a757d53ca33cfa15e622a1483a999c78bf88544 Mon Sep 17 00:00:00 2001 From: dfhoughton Date: Sun, 23 Dec 2018 16:32:24 -0500 Subject: removed unnecessary main.rs; added time of day handling --- src/lib.rs | 114 +++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 93 insertions(+), 21 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 437e438..8565b40 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,11 +6,11 @@ extern crate lazy_static; extern crate chrono; use chrono::offset::LocalResult; use chrono::{DateTime, Datelike, Duration, TimeZone, Timelike, Utc, Weekday}; -use pidgin::{Match, Matcher}; +use pidgin::{Grammar, Match, Matcher}; use regex::Regex; lazy_static! { - static ref GRAMMAR: Matcher = grammar!{ + static ref GRAMMAR: Grammar = grammar!{ (?ibBw) TOP -> r(r"\A") r(r"\z") @@ -21,7 +21,7 @@ lazy_static! { one_moment => two_moments -> to => [["to", "through", "until", "up to", "thru", "till"]] | r("-+") - at_moment -> ? ? |