dot_generator

Macro graph

Source
macro_rules! graph {
    (strict $id:expr) => { ... };
    ($id:expr) => { ... };
    (strict di $id:expr) => { ... };
    (di $id:expr) => { ... };
    (strict $id:expr, $stmts:expr) => { ... };
    ($id:expr, $stmts:expr) => { ... };
    (strict di $id:expr, $stmts:expr) => { ... };
    (di $id:expr, $stmts:expr) => { ... };
    (strict $id:expr; $($stmts:expr),+) => { ... };
    ($id:expr; $($stmts:expr),+) => { ... };
    (strict di $id:expr; $($stmts:expr),+) => { ... };
    (di $id:expr; $($stmts:expr),+) => { ... };
}
Expand description

represents a graph in dot lang.

  • strict word stands for strict in graph
  • di word stands for digraph #Example:
    fn graph_test() {
        use dot_generator::*;
        use dot_structures::*;

         assert_eq!(
            graph!(strict di id!("abc")),
            Graph::DiGraph { id: id!("abc"), strict: true, stmts: vec![] }
        );
        assert_eq!(
            graph!(strict di id!("abc");node!("abc")),
            Graph::DiGraph { id: id!("abc"), strict: true, stmts: vec![stmt!(node!("abc"))] }
        );
    }