Macro entity

Source
macro_rules! entity {
    ($name:expr; (
            $( $arg_name:expr, $arg_intern_kind:ident $arg_intern_name:tt, $arg_type:expr ),* $(,)?
        ) -> $output_type:expr; {
            $( $statement:tt );*
            $(;)?
        } => $output_name_kind:ident $output_name:tt
    ) => { ... };
}
Expand description

Example

use spade_mir as mir;
use spade_mir::entity;
use spade_mir::types::Type;
entity!("pong"; ("_i_clk", n(0, "clk"), Type::Bool) -> Type::int(6); {
    (e(0); Type::int(6); Add; n(1, "value"));
    (const 0; Type::int(10); ConstantValue::Int(6));
    (reg n(1, "value"); Type::int(6); clock (n(0, "clk")); e(0))
} => n(1, "value"));