Macro split_tokens::split_tokens [] [src]

macro_rules! split_tokens {
    (@inner () ( $($out:tt)* ) ( $m:ident $($args:tt)* ) ) => { ... };
    () => { ... };
    (@inner ( >> $($input:tt)* ) ( $($out:tt)* ) ( $m:ident $($args:tt)* ) ) => { ... };
    (@inner ( << $($input:tt)* ) ( $($out:tt)* ) ( $m:ident $($args:tt)* ) ) => { ... };
    (@inner ( += $($input:tt)* ) ( $($out:tt)* ) ( $m:ident $($args:tt)* ) ) => { ... };
    (@inner ( -= $($input:tt)* ) ( $($out:tt)* ) ( $m:ident $($args:tt)* ) ) => { ... };
    () => { ... };
    (@inner ( $a:tt $($input:tt)* ) ( $($out:tt)* ) ( $m:ident $($args:tt)* ) ) => { ... };
    ( ( $($input:tt)* ) then $m:ident ! ($($args:tt)*) ) => { ... };
}

Split compound tokens in their individual parts.

Warning

tokentrees are not traversed!

Usage

macro_rules! cb{
    ( ( $($args:tt)* ) ( $($out:tt)* ) ) => {
        //...
    }
}
split_tokens!( (>>+=-=<<) then cb!( /*args*/ ) );

Current split tokens

  • >>
  • <<
  • +=
  • -=