dot_generator

Macro node

Source
macro_rules! node {
    () => { ... };
    ($i:ident $id:expr) => { ... };
    ($id:expr) => { ... };
    ($i:ident $id:expr; $($attr:expr),+ ) => { ... };
    ($i:ident $id:expr, $attrs:expr  ) => { ... };
    ($id:expr, $attrs:expr  ) => { ... };
    ( $id:expr; $($attr:expr),+ ) => { ... };
    ($i:ident $id:expr => $p:expr, $attrs:expr  ) => { ... };
    ($i:ident $id:expr => $p:expr; $($attr:expr),+ ) => { ... };
    ( $id:expr => $p:expr, $attrs:expr  ) => { ... };
    ( $id:expr => $p:expr; $($attr:expr),+ ) => { ... };
}
Expand description

represents a node in dot lang. #Example:

    fn node_test() {
        use dot_generator::*;
        use dot_structures::*;

        assert_eq!(node!(), Node::new(NodeId(id!(), None), vec![]));
        assert_eq!(node!(html "abc"; attr!("a","a")),
                   Node::new(NodeId(id!(html "abc"), None),
                             vec![attr!("a","a")]));
        assert_eq!(node!(html "abc" ; attr!("a","a")),
                   Node::new(NodeId(id!(html "abc"), None),
                             vec![attr!("a","a")]));
        assert_eq!(node!("abc" ; attr!("a","a"),attr!("a","a")),
                   Node::new(NodeId(id!( "abc"), None),
                             vec![attr!("a","a"), attr!("a","a")]))
    }