#[macro_export]
macro_rules! morq {
(expect( $VALUE:expr ) . $($rest:tt)*) => {
morq!(Unknown, false, $VALUE, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, be . $($rest:tt)*) => {
morq!($ACTIVATOR, $NOT, $VALUE, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, to . $($rest:tt)*) => {
morq!($ACTIVATOR, $NOT, $VALUE, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, have . $($rest:tt)*) => {
morq!($ACTIVATOR, $NOT, $VALUE, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, not . $($rest:tt)*) => {
morq!($ACTIVATOR, !$NOT, $VALUE, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, true ( ) $($rest:tt)*) => {
morq!(Equal, $NOT, $VALUE, true, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, false ( ) $($rest:tt)*) => {
morq!(Equal, $NOT, $VALUE, false, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, ok ( ) $($rest:tt)*) => {
morq!(ResultCheck, $NOT, $VALUE.into_iter(), 0, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, err ( ) $($rest:tt)*) => {
morq!(ResultCheck, !$NOT, $VALUE.into_iter(), 0, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, equal ( $TARGET:expr ) $($rest:tt)*) => {
morq!(Equal, $NOT, $VALUE, $TARGET, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, close ( $TARGET:expr ) $($rest:tt)*) => {
morq!(Close, $NOT, $VALUE, $TARGET, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, close_to ( $TARGET:expr ) $($rest:tt)*) => {
morq!(Close, $NOT, $VALUE, $TARGET, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, empty ( ) $($rest:tt)*) => {
morq!(Empty, $NOT, $VALUE, 0, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, length_of ( $TARGET:expr ) $($rest:tt)*) => {
morq!(LengthOf, $NOT, $VALUE, $TARGET, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, contain ( $TARGET:expr ) $($rest:tt)*) => {
morq!(Contain, $NOT, $VALUE, $TARGET, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, a ( $TARGET:ty ) $($rest:tt)*) => {
morq!(TypeMatch, $NOT, $VALUE, $TARGET, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, an ( $TARGET:ty ) $($rest:tt)*) => {
morq!(TypeMatch, $NOT, $VALUE, $TARGET, $($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, $TARGET:ty, ; $($rest:tt)*) => {
evaluate(&$ACTIVATOR::new(), $VALUE, ::std::any::TypeId::of::<$TARGET>(), $NOT);
morq!($($rest)*);
};
($ACTIVATOR:ident, $NOT:expr, $VALUE:expr, $TARGET:expr, ; $($rest:tt)*) => {
evaluate(&$ACTIVATOR::new(), $VALUE, $TARGET, $NOT);
morq!($($rest)*);
};
() => ();
}