fn atom<'a>(atom: &Atom) -> D<'a> {
    match atom {
        Atom::Port(p) => match p {
            Port::Comp { component, port } => D::text(format!(
                "{}_{}",
                component.to_string(),
                port.to_string()
            )),
            Port::This { port } => D::text(port.to_string()),
            Port::Hole { .. } => unreachable!(
                "Holes should be caught in the backend validation."
            ),
        },
        Atom::Num(n) => D::text(format!("{}'d{}", n.width, n.val)),
    }
}
/// Converts ast::Atom to a verilog string
Converts ast::Atom to a verilog string
Converts ast :: Atom to a verilog string
fn atom<'a>(atom: &Atom) -> D<'a> {
    match atom {
        Atom::Port(p) => match p {
            Port::Comp { component, port } => D::text(format!(
                "{}_{}",
                component.to_string(),
                port.to_string()
            )),
            Port::This { port } => D::text(port.to_string()),
            Port::Hole { .. } => unreachable!(
                "Holes should be caught in the backend validation."
            ),
        },
        Atom::Num(n) => D::text(format!("{}'d{}", n.width, n.val)),
    }
}
fn atom < ' a > ( atom : & Atom ) -> D < ' a > { match atom { Atom :: Port ( p ) => match p { Port :: Comp { component , port } => D :: text ( format ! ( " " component to_string ( ) port to_string ( ) ) ) , Port :: This { port } => D :: text ( port . to_string ( ) ) , Port :: Hole { .. } => unreachable ! ( " " ) , } , Atom :: Num ( n ) => D :: text ( format ! ( " " n width n val ) ) , } }
Converts ast::Atom to a verilog string
Converts ast :: Atom to a verilog string
atom
&Atom