gobble
macro_rules! parser { ($id:ident,$x:expr) => { ... }; ($($doc:literal $(,)?)? ($id:ident -> $ot:ty) $(,)? $x:expr $(,)?) => { ... }; ($id:ident,$x:expr,$exp:expr) => { ... }; ($($doc:literal $(,)?)? ($id:ident -> $ot:ty) $(,)? $x:expr,$exp:expr $(,)?) => { ... }; }
Makes zero sized parsers based on the expression given and potentially the return type given.
use gobble::*; parser!{ (Cat->String), "cat".plus(), } assert_eq!(Cat.parse_s("ctar"),Ok("cta".to_string()));