Macro parser_fuck::and
source · macro_rules! and { { } => { ... }; { $input:expr } => { ... }; { $input:expr ; } => { ... }; { $input:expr ; $a:expr $(,)? } => { ... }; { $input:expr ; $a: expr, $($b: expr),+ $(,)? } => { ... }; }
Expand description
Only pass if all subparsers pass
Example
let code = "asd".span();
let r = and!(code; one('a'), one('s'), one('d'));
assert_eq!(r, Some((0..1, 1..2, 2..3)));