use std::{borrow::Cow, hash::Hash};
use bstr::BStr;
mod nom;
pub use self::nom::from_bytes;
mod event;
#[path = "events.rs"]
mod events_type;
pub use events_type::{Events, FrontMatterEvents};
mod comment;
mod error;
pub mod section;
mod key;
pub use key::{parse_unvalidated as key, Key};
#[cfg(test)]
pub(crate) mod tests;
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum Event<'a> {
Comment(Comment<'a>),
SectionHeader(section::Header<'a>),
SectionKey(section::Key<'a>),
Value(Cow<'a, BStr>),
Newline(Cow<'a, BStr>),
ValueNotDone(Cow<'a, BStr>),
ValueDone(Cow<'a, BStr>),
Whitespace(Cow<'a, BStr>),
KeyValueSeparator,
}
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub struct Section<'a> {
pub header: section::Header<'a>,
pub events: section::Events<'a>,
}
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
pub struct Comment<'a> {
pub tag: u8,
pub text: Cow<'a, BStr>,
}
#[derive(PartialEq, Debug)]
pub struct Error {
line_number: usize,
last_attempted_parser: error::ParseNode,
parsed_until: bstr::BString,
}