[][src]Macro bogobble::parser

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 bogobble::*;
parser!{
    (Cat->&'a str),
    "cat".plus(),
}
assert_eq!(Cat.parse_s("ctar"),Ok("cta"));