ddbug 0.5.0

Display debugging information
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use parser::{Namespace, NamespaceKind};

use crate::Result;
use crate::print::ValuePrinter;

pub(crate) fn print(namespace: &Namespace, w: &mut dyn ValuePrinter) -> Result<()> {
    if let Some(parent) = namespace.parent() {
        print(parent, w)?;
    }
    w.name(namespace.name().unwrap_or("<anon>"))?;
    if namespace.kind() == NamespaceKind::Function {
        write!(w, "()")?;
    }
    write!(w, "::")?;
    Ok(())
}