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

    macro_rules! call {
        ($i:expr, $fun:expr $(, $args:expr)*) => { ... };
    }

Invoke the given parser function with the passed in arguments.

- Syntax: `call!(FUNCTION, ARGS...)`

  where the signature of the function is `fn(&str, ARGS...) -> IResult<&str, T>`

- Output: `T`, the result of invoking the function `FUNCTION`

    #[macro_use] extern crate synom;

    use synom::IResult;

    // Parses any string up to but not including the given character, returning
    // the content up to the given character. The given character is required to
    // be present in the input string.
    fn skip_until(input: &str, ch: char) -> IResult<&str, &str> {
        if let Some(pos) = input.find(ch) {
            IResult::Done(&input[pos..], &input[..pos])
        } else {
            IResult::Error
        }
    }

    // Parses any string surrounded by tilde characters '~'. Returns the content
    // between the tilde characters.
    named!(surrounded_by_tilde -> &str, delimited!(
        punct!("~"),
        call!(skip_until, '~'),
        punct!("~")
    ));

    fn main() {
        let input = "~ abc def ~";

        let inner = surrounded_by_tilde(input).expect("surrounded by tilde");

        println!("{:?}", inner);
    }

# 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`)