Adapter for Nom
m4rw3r opened this issue · 0 comments
m4rw3r commented
Feature which enables an adapter-function to call out to a Nom parser.
impl<'a, I: 'a> Input<'a, I> {
// ...
fn nom_parser<T, E, F>(self, F) -> ParseResult<'a, I, T, E>
where F: FnOnce(&'a [I]) -> nom::IResult<&'a [I], T, E>;
}
Use a closure if extra parameters need to be passed to the Nom parser.
Also needs to support an error type allowing for both Nom's Err
type as well as Chomp's parsers::Error
.