Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/items/epoch.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use winnow::{combinator::preceded, ModalResult, Parser};

use super::primitive::{dec_int, s};

pub fn parse(input: &mut &str) -> ModalResult<i32> {
s(preceded("@", dec_int)).parse_next(input)
}
26 changes: 3 additions & 23 deletions src/items/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,15 @@
#![allow(deprecated)]
mod combined;
mod date;
mod epoch;
mod ordinal;
mod primitive;
mod relative;
mod time;
mod timezone;
mod weekday;

mod epoch {
use winnow::{combinator::preceded, ModalResult, Parser};

use super::primitive::{dec_int, s};

pub fn parse(input: &mut &str) -> ModalResult<i32> {
s(preceded("@", dec_int)).parse_next(input)
}
}

mod timezone {
use winnow::ModalResult;

use super::time;

pub(crate) fn parse(input: &mut &str) -> ModalResult<time::Offset> {
time::timezone(input)
}
}

use chrono::NaiveDate;
use chrono::{DateTime, Datelike, FixedOffset, TimeZone, Timelike};

use chrono::{DateTime, Datelike, FixedOffset, NaiveDate, TimeZone, Timelike};
use primitive::space;
use winnow::{
combinator::{alt, trace},
Expand Down
10 changes: 10 additions & 0 deletions src/items/timezone.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.

use winnow::ModalResult;

use super::time;

pub(crate) fn parse(input: &mut &str) -> ModalResult<time::Offset> {
time::timezone(input)
}
Loading