[][src]Macro gstuff::parse_replace_s

macro_rules! parse_replace_s {
    ($i: expr, $submac: ident! ($($args:tt)*)) => { ... };
    ($i: expr, $f: expr) => { ... };
}

Uses nom to find all matches of the given $submac parser and replace them with the $submac results.

For exaple, replacing "foo" with "bar" might look like this:

use nom::{self, IResult};
let bar_bar = parse_replace_s! ("foo bar", map! (tag_s! ("foo"), |_| "bar"));