Macro unrest_tmp_synom::terminated [] [src]

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

Parse two things, returning the value of the first.

  • Syntax: terminated!(THING, AFTER)
  • Output: THING
extern crate syn;
#[macro_use] extern crate synom;

use syn::Expr;
use synom::tokens::Pound;

// An expression terminated by ##.
named!(expr_pound_pound -> Expr,
    terminated!(syn!(Expr), tuple!(syn!(Pound), syn!(Pound)))
);