macro_rules! guard {
    ($node:ident[$port:expr]) => { ... };
    ( ( $($head:tt)* ) ) => { ... };
    ($e:ident) => { ... };
    ($node:ident[$port:expr] >= $($tail:tt)*) => { ... };
    ($node:ident[$port:expr] <= $($tail:tt)*) => { ... };
    ($node:ident[$port:expr] < $($tail:tt)*) => { ... };
    ($node:ident[$port:expr] > $($tail:tt)*) => { ... };
    ($node:ident[$port:expr] == $($tail:tt)*) => { ... };
    ($node:ident[$port:expr] != $($tail:tt)*) => { ... };
    ($node:ident[$port:expr] & $($tail:tt)*) => { ... };
    ( ( $($head:tt)* ) & $($tail:tt)*) => { ... };
    ($node:ident[$port:expr] | $($tail:tt)*) => { ... };
    ( ( $($head:tt)* ) | $($tail:tt)*) => { ... };
}
Expand description

Parse guard expression into ir::Guard.

The identifier should either be a ir::Group or an ir::Cell. Example:

let fsm_out = guard!(fsm["out"] == lb["out"] & g);

The macro supports constructing guards using the following operators:

  • Port access: node[port]
  • Comparison operators: ==, >=, <=, >, <
  • Logical operators: &, |
  • Parentheses: ()