parsy 0.16.3

An easy-to-use, efficient parser combinators library
Documentation
use crate::{Parser, ParserInput, ParserResult, Span};

/// See [`empty`](`crate::parsers::helpers::empty`)
#[derive(Clone, Copy)]
pub struct Empty;

impl Empty {
    pub const fn new() -> Self {
        Self
    }
}

impl Default for Empty {
    fn default() -> Self {
        Self::new()
    }
}

impl Parser<()> for Empty {
    fn parse_inner(&self, input: &mut ParserInput) -> ParserResult<()> {
        Ok(Span::ate(input.range(0), ()))
    }
}