summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-10-22 21:47:14 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-10-22 21:47:14 +0200
commit1ac1641dc5a0e54e0362081c2113427f2e35a8cc (patch)
tree77669d0d51fdaebd5e804af4f9fae1bff40d304d
parent4e2dc0a0728b280d2ff01da452eea319b660187c (diff)
Design syntax
-rw-r--r--src/parser.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 83c05a1..4820668 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -5,13 +5,34 @@
//!
//! # Syntax
//!
+//! ## Units
//!
+//! UnitSec = "second" | "seconds" | "sec" | "secs" | "s"
+//! UnitMin = "minute" | "minutes" | "min" | "mins"
+//! UnitHr = "hour" | "hours" | "hr" | "hrs"
+//! UnitDay = "day" | "days" | "d"
+//! UnitWeek = "week" | "weeks" | "w"
+//! UnitMonth = "month" | "months" |
+//! UnitYear = "year" | "years" | "yrs"
+//! Unit = UnitSec | UnitMin | UnitHr | UnitDay | UnitWeek | UnitMonth | UnitYear
//!
+//! ## Operators
//!
+//! Operator = "+" | "-"
//!
+//! ## Intermediate syntax nodes
//!
+//! Amount = "<Number><Unit>"
//!
+//! TextIterSpec = "secondly" | "minutely" | "hourly" | "daily" | "weekly" | "monthly" | "yearly"
+//! Iterspec = TextIterSpec | "every" <Number><Unit>
//!
+//! ## User-facing syntax nodes
+//!
+//! AmountExp = <Amount> (<Operator> <AmountExp>)?
+//! ExactDate = "today" | "yesterday" | "tomorrow" | <Iso8601>
+//! Date = <ExactDate> (<Operator> <AmountExp>)?
+//! Iterator = <Date> <Iterspec> ("until" <ExactDate> | <number> "times")?
//!
mod grammar {