use super::*;
impl PrettyPrint for GenericCallNode {
fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
let mut terms = PrettySequence::new(3);
terms += "⦓";
terms += theme.join(&self.terms, ", ");
terms += "⦔";
terms.into()
}
}
impl PrettyPrint for GenericCallTerm {
fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
let mut terms = PrettySequence::new(3);
if let Some(k) = &self.term.key {
terms += theme.generic(k.name.to_owned());
terms += ": ";
}
terms += self.term.value.pretty(theme);
terms.into()
}
}
impl PrettyPrint for GenericArgumentNode {
fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
let mut terms = PrettySequence::new(3);
terms += "⦓";
terms += theme.join(&self.terms, ", ");
terms += "⦔";
terms.into()
}
}
impl PrettyPrint for GenericArgumentTerm {
fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
let mut terms = PrettySequence::new(5);
terms += theme.generic(self.term.key.name.to_owned());
if let Some(k) = &self.term.value {
terms += ": ";
terms += k.pretty(theme);
}
if let Some(k) = &self.term.default {
terms += " = ";
terms += k.pretty(theme);
}
terms.into()
}
}