valkyrie-ast 0.1.4

Strong typed abstract syntax tree of valkyrie language
Documentation
use super::*;

impl PrettyPrint for EnumerateDeclaration {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        let mut terms = PrettySequence::new(4);
        terms += theme.keyword("enumerate");
        terms += " ";
        terms += self.namepath.pretty(theme);
        terms += self.body.pretty(theme);
        terms.into()
    }
}

impl PrettyPrint for EnumerateFieldDeclaration {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        let mut terms = PrettySequence::new(3);
        terms += self.name.pretty(theme);
        if let Some(value) = &self.value {
            terms += " ";
            terms += theme.operator("=");
            terms += " ";
            terms += value.pretty(theme);
        }
        terms += ",";
        terms.into()
    }
}