# Macro synom::do_parse [−] [src]

    macro_rules! do_parse {
        ($i:expr, ( $($rest:expr),* )) => { ... };
        ($i:expr, $e:ident >> $($rest:tt)*) => { ... };
        ($i:expr, $submac:ident!( $($args:tt)* ) >> $($rest:tt)*) => { ... };
        ($i:expr, $field:ident : $e:ident >> $($rest:tt)*) => { ... };
        ($i:expr, $field:ident : $submac:ident!( $($args:tt)* ) >> $($rest:tt)*) => { ... };
        ($i:expr, mut $field:ident : $e:ident >> $($rest:tt)*) => { ... };
        ($i:expr, mut $field:ident : $submac:ident!( $($args:tt)* ) >> $($rest:tt)*) => { ... };
    }

Run a series of parsers, one after another, optionally assigning the results a name. Fail if any of the parsers fails.

Produces the result of evaluating the final expression in parentheses with all of the previously named results bound.

- Syntax: `do_parse!(name: THING1 >> THING2 >> (RESULT))`
- Output: `RESULT`

    extern crate syn;
    #[macro_use] extern crate synom;

    use syn::{Ident, TokenTree};
    use syn::parse::{ident, tt};

    // Parse a macro invocation like `stringify!($args)`.
    named!(simple_mac -> (Ident, TokenTree), do_parse!(
        name: ident >>
        punct!("!") >>
        body: tt >>
        (name, body)
    ));

    fn main() {
        let input = "stringify!($args)";
        let (name, body) = simple_mac(input).expect("macro invocation");
        println!("{:?}", name);
        println!("{:?}", body);
    }

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)