Macro nom::sep
[−]
[src]
macro_rules! sep { ($i:expr, $separator:ident, tuple ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, pair ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, delimited ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, separated_pair ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, preceded ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, terminated ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, do_parse ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, permutation ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, alt ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, alt_complete ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, switch ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, separated_list ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, many0 ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, many1 ! ($($rest:tt)*) ) => { ... }; ($i:expr, $separator:ident, $submac:ident!( $($args:tt)* )) => { ... }; ($i:expr, $separator:ident, $f:expr) => { ... }; }
sep is the parser rewriting macro for whitespace separated formats
it takes as argument a space eating function and a parser tree, and will intersperse the space parser everywhere
#[macro_export] macro_rules! ws ( ($i:expr, $($args:tt)*) => ( { use $crate::sp; sep!($i, sp, $($args)*) } ) );