Macro abortable_parser::repeat[][src]

macro_rules! repeat {
    ($i : expr, $f : ident! ($($args : tt) *)) => { ... };
    ($i : expr, $f : ident) => { ... };
}
Expand description

Runs a single matcher repeating 0 or more times and returns a possibly empty vector of the parsed results.

use abortable_parser::iter;
let input_str = "foofoo";
let iter = iter::SliceIter::new(input_str.as_bytes());
let result = repeat!(iter, text_token!("foo"));
if let Result::Complete(_, o) = result {
    assert_eq!(2, o.len());
    assert_eq!("foo", o[0]);
    assert_eq!("foo", o[1]);
}