mirror of
https://gitee.com/openharmony/third_party_rust_nom
synced 2024-11-27 01:30:32 +00:00
missing named_args alternatives
This commit is contained in:
parent
7d14e5bf6c
commit
f2d658ed2f
@ -188,6 +188,22 @@ macro_rules! named_args {
|
||||
$submac!(input, $($args)*)
|
||||
}
|
||||
};
|
||||
(pub $func_name:ident < 'a > ( $( $arg:ident : $typ:ty ),* ) < $input_type:ty, $return_type:ty > , $submac:ident!( $($args:tt)* ) ) => {
|
||||
fn $func_name<'a>(
|
||||
input: $input_type, $( $arg : $typ ),*)
|
||||
-> $crate::IResult<$input_type, $return_type>
|
||||
{
|
||||
$submac!(input, $($args)*)
|
||||
}
|
||||
};
|
||||
($func_name:ident < 'a > ( $( $arg:ident : $typ:ty ),* ) < $input_type:ty, $return_type:ty > , $submac:ident!( $($args:tt)* ) ) => {
|
||||
fn $func_name<'a>(
|
||||
input: $input_type, $( $arg : $typ ),*)
|
||||
-> $crate::IResult<$input_type, $return_type>
|
||||
{
|
||||
$submac!(input, $($args)*)
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// Makes a function from a parser combination, with attributes
|
||||
|
Loading…
Reference in New Issue
Block a user