Macro branch

Source
macro_rules! branch {
    (if $($value:ident)? == $expected:ident { $($then:tt)* } else { $($else:tt)* }) => { ... };
    (if $($value:ident)? == $expected:ident { $($then:tt)* } ) => { ... };
}