1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use std::path::PathBuf;

#[derive(PartialEq, Eq, Debug)]
pub enum Reason {
    FailedDetermineType,
    ExpectedMapKey,
    ExpectedListItem,
    ImpermissibleSpace,
    ImpermissibleTab,
    AnchorAlreadyExists,
    IncompleteString,
    IncompleteDocument,
    NonexistentFile,
}

#[derive(PartialEq, Eq, Debug)]
pub struct ParseError {
    pub file_path: PathBuf,
    pub reason: Reason,
}

pub mod marked {
    use crate::data::{error::with_mark::WithMarkError, mark::Mark};
    use nom::IResult;

    pub type ParseError = WithMarkError<super::ParseError>;
    pub type ParseResult<I, O, E = nom::error::Error<I>> = IResult<I, (Mark, O), E>;
}