Macro nom_locate::impl_find_token [] [src]

macro_rules! impl_find_token {
    ( $for_type:ty, $fragment_type:ty) => { ... };
}

Implement nom::FindToken for a specific token type.

Parameters

  • $for_type - The token type.
  • $fragment_type - The LocatedSpan's fragment type which has to be searchable.

Example of use

NB: This example is an extract from the nom_locate source code.

#[macro_use]
extern crate nom_locate;

impl_find_token! { char, &'a str}

impl_find_token! { u8, &'a str}
impl_find_token! { &'b u8, &'a str}

impl_find_token! { u8, &'a [u8]}
impl_find_token! { &'b u8, &'a [u8]}