Skip to content

Commit 77e1ab2

Browse files
authored
Merge pull request #188 from yuankunzhang/update-comments
Update comments
2 parents 0ddeec7 + a48ad6a commit 77e1ab2

File tree

3 files changed

+24
-19
lines changed

3 files changed

+24
-19
lines changed

src/items/mod.rs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ pub(crate) fn at_local(
114114
/// literal2_date = literal_month , [ { whitespace } ] , day , [ [ literal2_date_delim ] , year ] ;
115115
/// literal2_date_delim = { whitespace } | [ { whitespace } ] , "," , [ { whitespace } ] ;
116116
///
117-
/// year = dec_int ;
118-
/// month = dec_int ;
119-
/// day = dec_int ;
117+
/// year = dec_uint ;
118+
/// month = dec_uint ;
119+
/// day = dec_uint ;
120120
///
121121
/// literal_month = "january" | "jan"
122122
/// | "february" | "feb"
@@ -130,6 +130,25 @@ pub(crate) fn at_local(
130130
/// | "october" | "oct"
131131
/// | "november" | "nov"
132132
/// | "december" | "dec" ;
133+
///
134+
/// weekday = [ ordinal ] day [ "," ] ;
135+
///
136+
/// ordinal = number_ordinal | text_ordinal ;
137+
///
138+
/// number_ordinal = [ "+" | "-" ] , dec_uint ;
139+
///
140+
/// text_ordinal = "last" | "this" | "next" | "first"
141+
/// | "third" | "fourth" | "fifth" | "sixth"
142+
/// | "seventh" | "eighth" | "ninth" | "tenth"
143+
/// | "eleventh" | "twelfth" ;
144+
///
145+
/// day = "monday" | "mon" | "mon."
146+
/// | "tuesday" | "tue" | "tue." | "tues"
147+
/// | "wednesday" | "wed" | "wed." | "wednes"
148+
/// | "thursday" | "thu" | "thu." | "thur" | "thurs"
149+
/// | "friday" | "fri" | "fri."
150+
/// | "saturday" | "sat" | "sat."
151+
/// | "sunday" | "sun" | "sun." ;
133152
/// ```
134153
pub(crate) fn parse(input: &mut &str) -> ModalResult<DateTimeBuilder> {
135154
trace("parse", alt((parse_timestamp, parse_items))).parse_next(input)

src/items/ordinal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use winnow::{
99

1010
use super::primitive::{dec_uint, s};
1111

12-
pub fn ordinal(input: &mut &str) -> ModalResult<i32> {
12+
pub(super) fn ordinal(input: &mut &str) -> ModalResult<i32> {
1313
alt((text_ordinal, number_ordinal)).parse_next(input)
1414
}
1515

src/items/weekday.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,21 +61,7 @@ impl From<Day> for chrono::Weekday {
6161
}
6262

6363
/// Parse a weekday item.
64-
///
65-
/// Grammar:
66-
///
67-
/// ```ebnf
68-
/// weekday = [ ordinal ] day [ "," ] ;
69-
///
70-
/// day = "monday" | "mon" | "mon."
71-
/// | "tuesday" | "tue" | "tue." | "tues"
72-
/// | "wednesday" | "wed" | "wed." | "wednes"
73-
/// | "thursday" | "thu" | "thu." | "thur" | "thurs"
74-
/// | "friday" | "fri" | "fri."
75-
/// | "saturday" | "sat" | "sat."
76-
/// | "sunday" | "sun" | "sun." ;
77-
/// ```
78-
pub fn parse(input: &mut &str) -> ModalResult<Weekday> {
64+
pub(super) fn parse(input: &mut &str) -> ModalResult<Weekday> {
7965
seq!(Weekday {
8066
offset: opt(ordinal).map(|o| o.unwrap_or_default()),
8167
day: terminated(day, opt(s(","))),

0 commit comments

Comments
 (0)