mirror of
https://gitee.com/openharmony/third_party_rust_nom
synced 2024-11-27 01:30:32 +00:00
use fold_many0c in the fold_many0 macro
This commit is contained in:
parent
b7e201fe84
commit
6168f7b7e1
@ -458,7 +458,7 @@ macro_rules! fold_many0(
|
||||
fold_many0!($i, |i| $submac!(i, $($args)*), $init, $fold_f)
|
||||
);
|
||||
($i:expr, $f:expr, $init:expr, $fold_f:expr) => (
|
||||
$crate::multi::fold_many0($f, $init, $fold_f)($i)
|
||||
$crate::multi::fold_many0c($i, $f, $init, $fold_f)
|
||||
);
|
||||
);
|
||||
|
||||
|
@ -337,3 +337,13 @@ fn issue_1027_convert_error_panic_nonempty() {
|
||||
"0: at line 1:\na\n ^\nexpected \'b\', got end of input\n\n"
|
||||
);
|
||||
}
|
||||
|
||||
named!(issue_962<&[u8], Vec<&[u8]>>,
|
||||
fold_many0!(
|
||||
alt!(tag!("aaaa") | tag!("bbbb")),
|
||||
Vec::new(), |mut acc: Vec<_>, item| {
|
||||
acc.push(item);
|
||||
acc
|
||||
}
|
||||
)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user