Macro new_op1_opt

Source
macro_rules! new_op1_opt {
    ($s:ident, $name:expr, $($t1:ident -> $rt:ident { $f:expr }),*) => { ... };
}
Expand description

Defines a macro for creating a new unary operation.

This macro simplifies the process of defining new unary operators by automating the implementation of necessary traits and logic. It first abstracts over the implementation of basic traits and characteristics by invoking impl_basic! with the specified identifier and name. Then, it ensures the new type implements Enumerator1, which likely facilitates iterating over or evaluating expressions. Finally, the macro invokes impl_op1_opt!, passing along the type, operation name, and mapping of input types to result types along with associated function logic. Through this structured approach, multiple unary operations with various input types and results can be efficiently defined and integrated into the synthesis framework.