Converters between combine and nom.
```rust extern crate combine; extern crate nom; extern crate nombine;
use std::collections::HashMap;
use combine::error::ParseError; use combine::parser::char::char; use combine::parser::range; use combine::stream::FullRangeStream; use combine::{Parser, sep_by};
use nombine::{convertfromcombine, fromcombine, fromnom};
fn fromhex(input: &str) -> Result
fn ishexdigit(c: char) -> bool { match c { '0'..='9' | 'a'..='f' | 'A'..='F' => true, _ => false, } }
named!(hex<&str, u8>, mapres!(takewhilemn!(2, 2, ishexdigit), from_hex) );
fn identifier<'a, I>() -> impl Parser
where
I: FullRangeStream
named!(field<&str, (&str, u8)>, map!(convertfromcombine((identifier(), char('='), fromnom(hex)), || 0), move |(name, _, value)| (name, value)) );
fn fields<'a, I>() -> impl Parser>
where
I: FullRangeStream
// Parse using nom's interface asserteq!( fromcombine(fields())("fieldA=2F,fieldB=00"), Ok(( "", vec![ ( "fieldA", 47, ), ( "fieldB", 0, ), ].into_iter().collect(), )) );
// Parse using combine's interface asserteq!( fields().easyparse("fieldA=2F,fieldB=00"), Ok(( vec![ ( "fieldA", 47, ), ( "fieldB", 0, ), ].into_iter().collect(), "", )) ); ```