#[macro_export]
#[doc(hidden)]
macro_rules! __perform {
( $input:tt, $macro:path $( [ $($args:tt)* ] )? ) => {
$macro ! ( @entry next=$crate::__perform[[@complete]], input=$input $(, args=[$($args)*])? );
};
( [@complete], ($($input:tt)*) ) => {
$($input)*
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __debug {
( @entry next=$next:path[$next_args:tt], input=$input:tt ) => {
const _: () = { stringify! $input ; };
$next ! ( $next_args, $input );
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __stringify {
( @entry next=$next:path[$next_args:tt], input=$input:tt, args=[$(prefix=[$($prefix:tt)*])? $(suffix=[$($suffix:tt)*])?] ) => {
$next ! ( $next_args, ($($($prefix)*)? stringify! $input $($($suffix)*)? ) );
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __emit {
( @entry next=$next:path[$next_args:tt], input=$input:tt, args=[$($args:tt)*] ) => {
$next ! ( $next_args, ($($args)*) );
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __surround {
( @entry next=$next:path[$next_args:tt], input=($($input:tt)*),
args=[ $( prefix=[$($prefix:tt)*] )? $( suffix=[$($suffix:tt)*] )? ] ) => {
$next ! ( $next_args, ( $($($prefix)*)? $($input)* $($($suffix)*)? ) );
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __brace {
( @entry next=$next:path[$next_args:tt], input=($($input:tt)*), args=[ () ] ) => {
$next ! ( $next_args, ( ( $($input)* ) ) );
};
( @entry next=$next:path[$next_args:tt], input=($($input:tt)*), args=[ [] ] ) => {
$next ! ( $next_args, ( [ $($input)* ] ) );
};
( @entry next=$next:path[$next_args:tt], input=($($input:tt)*), args=[ {} ] ) => {
$next ! ( $next_args, ( { $($input)* } ) );
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __unbrace {
( @entry next=$next:path[$next_args:tt], input=(($($input:tt)*))) => {
$next ! ( $next_args, ( $($input)* ) );
};
( @entry next=$next:path[$next_args:tt], input=([$($input:tt)*])) => {
$next ! ( $next_args, [ $($input)* ] );
};
( @entry next=$next:path[$next_args:tt], input=({$($input:tt)*})) => {
$next ! ( $next_args, { $($input)* } );
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __identity {
( @entry next=$next:path[$next_args:tt], input=$input:tt ) => {
$next!($next_args, $input);
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __sink {
( @entry next=$next:path[$next_args:tt], input=$input:tt ) => {};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __split {
( @entry next=$next:path[$next_args:tt], input=$input:tt, args=[
$($macro:path $([$($args:tt)*])?),*
$(,)?
] ) => {
$(
$macro ! ( @entry next=$next[$next_args], input=$input $(, args=[$($args)*])? );
)*
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __parallel {
( @entry next=$next:path[$next_args:tt], input=$input:tt, args=$args:tt ) => {
$crate::__parallel!( @process $input, $args, (), [$next[$next_args]] );
};
( @process $input:tt, [], $accum:tt, [$next:path[$next_args:tt]] ) => {
$next ! ( $next_args, $accum );
};
( @process $input:tt, [$next:path $([$($args:tt)*])?, $($stack:tt)*], $accum:tt, $final:tt ) => {
$next!(
@entry next=$crate::__parallel[[@continue [$($stack)*] $input $accum $final]],
input=$input $(, args=[$($args)*])?
);
};
( [@continue [$($stack:tt)*] $input:tt ($( $accum:tt )*) $final:tt], ($($output:tt)*) ) => {
$crate::__parallel!( @process $input, [$($stack)*], ($($accum)* $($output)*), $final);
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __chain {
( @entry next=$next:path[$next_args:tt], input=$input:tt, args=[$($args:tt)*] ) => {
$crate::__chain!( @process $input, [$($args)*], [$next[$next_args]] );
};
( @process $input:tt, [], [$next:path[$next_args:tt]] ) => {
$next ! ( $next_args, $input );
};
( @process $input:tt, [$next:path $([$($args:tt)*])?, $($stack:tt)*], $final:tt ) => {
$next!( @entry next=$crate::__chain[[@continue [$($stack)*] $final]], input=$input $(, args=[$($args)*])?);
};
( [@continue [$($stack:tt)*] $final:tt], $input:tt ) => {
$crate::__chain!( @process $input, [$($stack)*], $final);
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __separate {
( @entry next=$next:path[$next_args:tt], input=$input:tt, args=$args:tt ) => {
$crate::__separate!( @process $input, $args, (), [$next[$next_args]] );
};
( @process $input:tt, [], $accum:tt, [$next:path[$next_args:tt]] ) => {
$next ! ( $next_args, $accum );
};
( @process ($input:tt $($input_rest:tt)*), [$next:path $([$($args:tt)*])?, $($stack:tt)*], $accum:tt, $final:tt ) => {
$next!(
@entry next=$crate::__separate[[@continue [$($stack)*] ($($input_rest)*) $accum $final]],
input=$input $(, args=[$($args)*])?
);
};
( [@continue [$($stack:tt)*] $input:tt ($( $accum:tt )*) $final:tt], ($($output:tt)*) ) => {
$crate::__separate!( @process $input, [$($stack)*], ($($accum)* $($output)*), $final);
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __zip {
( @entry next=$next:path[$next_args:tt], input=$input:tt ) => {
$crate::__zip!( @process accum=(), input=$input, next=[$next[$next_args]] );
};
( @process accum=$accum:tt, input=($(())*), next=[$next:path[$next_args:tt]] ) => {
$next ! ( $next_args, $accum );
};
( @process accum=($($accum:tt)*), input=(
$( ($first:tt $($inner:tt)*) )*
), next=$next:tt ) => {
$crate::__zip!( @process accum=($($accum)* ($($first)*)), input=($(($($inner)*))*), next=$next );
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __pick {
( @entry next=$next:path[$next_args:tt], input=$input:tt, args=$args:tt ) => {
$crate::__pick!( @process $input, $input, (), $args, [$next[$next_args]] );
};
( @process $input:tt, $input_:tt, $accum:tt, [], [$next:path[$next_args:tt]] ) => {
$next ! ( $next_args, $accum );
};
( @process ($i0:tt $($rest:tt)*), $input:tt, ($($accum:tt)*), [0 $($args:tt)*], $next:tt) => {
$crate::__pick!( @process $input, $input, ($($accum)* $i0), [$($args)*], $next );
};
( @process ($i0:tt $i1:tt $($rest:tt)*), $input:tt, ($($accum:tt)*), [1 $($args:tt)*], $next:tt) => {
$crate::__pick!( @process $input, $input, ($($accum)* $i1), [$($args)*], $next );
};
( @process ($i0:tt $i1:tt $i2:tt $($rest:tt)*), $input:tt, ($($accum:tt)*), [2 $($args:tt)*], $next:tt) => {
$crate::__pick!( @process $input, $input, ($($accum)* $i2), [$($args)*], $next );
};
( @process ($i0:tt $i1:tt $i2:tt $i3:tt $($rest:tt)*), $input:tt, ($($accum:tt)*), [3 $($args:tt)*], $next:tt) => {
$crate::__pick!( @process $input, $input, ($($accum)* $i3), [$($args)*], $next );
};
( @process ($i0:tt $i1:tt $i2:tt $i3:tt $i4:tt $($rest:tt)*), $input:tt, ($($accum:tt)*), [4 $($args:tt)*], $next:tt) => {
$crate::__pick!( @process $input, $input, ($($accum)* $i4), [$($args)*], $next );
};
( @process ($i0:tt $i1:tt $i2:tt $i3:tt $i4:tt $i5:tt $($rest:tt)*), $input:tt, ($($accum:tt)*), [5 $($args:tt)*], $next:tt) => {
$crate::__pick!( @process $input, $input, ($($accum)* $i5), [$($args)*], $next );
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __for_each {
( @entry next=$next:path[$next_args:tt], input=$input:tt, args=[$macro_name:path $([$($args:tt)*])?] ) => {
$crate::__for_each!( @process accum=(), input=$input, args=[$macro_name $([$($args)*])?], next=[$next[$next_args]] );
};
( @process accum=$accum:tt, input=(), args=$args:tt, next=[$next:path [$next_args:tt]] ) => {
$next ! ( $next_args, $accum );
};
( @process accum=$accum:tt, input=($input:tt $($rest:tt)*), args=[$macro_name:path $( [$($macro_args:tt)*] )?], next=$next:tt) => {
$macro_name ! ( @entry next=$crate::__for_each[
[@continue $accum, ($($rest)*), [$macro_name $( [$($macro_args)*] )?], $next]
], input=($input) $(, args=[$($macro_args)*])? );
};
( [@continue ($($accum:tt)*), $input:tt, $args:tt, $next:tt], ($($output:tt)*) ) => {
$crate::__for_each!( @process accum=($($accum)* $($output)*), input=$input, args=$args, next=$next );
};
( $($input:tt)* ) => {
const _: () = { compile_error!(concat!("Unexpected input for __for_each: ", stringify!($($input)*))); };
};
}
#[macro_export]
#[doc(hidden)]
macro_rules! __call {
( @entry next=$next:path[$next_args:tt], input=($($input:tt)*), args=[$macro_name:path $([$($args:tt)*])?] ) => {
$macro_name ! ( @entry next=$next[$next_args], input=($($input)*) $(, args=[$($args)*])? );
};
}