Start reorganizing code by creating files module

This commit is contained in:
Joscha 2021-11-21 22:48:41 +01:00
parent f1ff3f7aaa
commit 5674bcdc00
5 changed files with 232 additions and 16 deletions

View file

@ -2,7 +2,7 @@ use std::path::Path;
use std::result;
use chrono::NaiveDate;
use pest::error::{Error, ErrorVariant};
use pest::error::ErrorVariant;
use pest::iterators::Pair;
use pest::prec_climber::{Assoc, Operator, PrecClimber};
use pest::{Parser, Span};
@ -16,9 +16,10 @@ use crate::commands::{
#[grammar = "parse/todayfile.pest"]
struct TodayfileParser;
type Result<T> = result::Result<T, Error<Rule>>;
pub type Error = pest::error::Error<Rule>;
pub type Result<T> = result::Result<T, Error>;
fn error<S: Into<String>>(span: Span, message: S) -> Error<Rule> {
fn error<S: Into<String>>(span: Span, message: S) -> Error {
Error::new_from_span(
ErrorVariant::CustomError {
message: message.into(),