#[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= [$nextc:path $([$($argsc:tt)*])?, $($stack:tt)*] ) => {
$nextc!( @entry next=$crate::__chain[[@continue [$($stack)*] [$next[$next_args]]]], input=$input $(, args=[$($argsc)*])?);
};
( @process $input:tt, [$next:path $([$($args:tt)*])?, $($stack:tt)*], $final:tt ) => {
$next!( @entry next=$crate::__chain[[@continue [$($stack)*] $final]], input=$input $(, args=[$($args)*])?);
};
( [@continue [] [$next:path[$next_args:tt]]], $input:tt ) => {
$next ! ( $next_args, $input );
};
( [@continue [$next:path $([$($args:tt)*])?, $($stack:tt)*] $final:tt], $input:tt ) => {
$next!( @entry next=$crate::__chain[[@continue [$($stack)*] $final]], input=$input $(, args=[$($args)*])?);
};
( $($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=($i0:tt $($rest:tt)*), args=[0]) => {
$next ! ( $next_args, ($i0) );
};
( @entry next=$next:path[$next_args:tt], input=($i0:tt $i1:tt $($rest:tt)*), args=[1]) => {
$next ! ( $next_args, ($i1) );
};
( @entry next=$next:path[$next_args:tt], input=($i0:tt $i1:tt $i2:tt $($rest:tt)*), args=[2]) => {
$next ! ( $next_args, ($i2) );
};
( @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=(), args=[$macro_name:path $([$($args:tt)*])?] ) => {
$next ! ( $next_args, () );
};
( @entry next=$next:path[$next_args:tt], input=($input:tt $($rest:tt)*), args=[$macro_name:path $([$($macro_args:tt)*])?] ) => {
$macro_name ! ( @entry next=$crate::__for_each[
[@continue (), ($($rest)*), [$macro_name $( [$($macro_args)*] )?], [$next[$next_args]]]
], input=($input) $(, args=[$($macro_args)*])? );
};
( [@continue ($($accum:tt)*), ($input:tt $($rest:tt)*), [$macro_name:path $( [$($macro_args:tt)*] )?], $next:tt], ($($output:tt)*) ) => {
$macro_name ! ( @entry next=$crate::__for_each[
[@continue ($($accum)* $($output)*), ($($rest)*), [$macro_name $( [$($macro_args)*] )?], $next]
], input=($input) $(, args=[$($macro_args)*])? );
};
( [@continue ($($accum:tt)*), (), $macro:tt, [$next:path[$next_args:tt]]], ($($output:tt)*) ) => {
$next ! ( $next_args, ($($accum)* $($output)*) );
};
( $($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)*])? );
};
}