use core::marker::PhantomData;
use super::{Cursor, Lexer};
pub struct Checkpoint<'a, 'closure, L: Lexer<'a>> {
cursor: Cursor<'a, 'closure, L>,
pub(crate) state: L::State,
_m: PhantomData<fn(&'closure ()) -> &'closure ()>,
}
impl<'a, 'closure, L: Lexer<'a>> Checkpoint<'a, 'closure, L> {
#[cfg_attr(not(tarpaulin), inline(always))]
pub(super) const fn new(cursor: Cursor<'a, 'closure, L>, state: L::State) -> Self {
Self {
cursor,
state,
_m: PhantomData,
}
}
#[cfg_attr(not(tarpaulin), inline(always))]
pub const fn cursor(&self) -> &Cursor<'a, 'closure, L> {
&self.cursor
}
#[cfg_attr(not(tarpaulin), inline(always))]
pub const fn state(&self) -> &L::State {
&self.state
}
}