use crate::bnf::Bnf; use crate::parser::{ParseResult, Parser, ParserInput}; pub struct BoxedParser<'a, I, O, E> where I: ParserInput, { inner: Box + 'a>, } impl<'a, I, O, E> BoxedParser<'a, I, O, E> where I: ParserInput, { pub(crate) fn new

(inner: P) -> Self where P: Parser + 'a, { BoxedParser { inner: Box::new(inner), } } } impl<'a, I: ParserInput, O, E> Parser for BoxedParser<'a, I, O, E> { fn parse(&self, input: I) -> ParseResult { self.inner.parse(input) } fn bnf(&self) -> Option { self.inner.bnf() } }