1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use super::*;

impl PrettyPrint for OperatorNode {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        theme.operator(self.kind.as_str())
    }
}

impl PrettyPrint for PrefixNode {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        self.operator.pretty(theme).append(self.base.pretty(theme))
    }
}

impl PrettyPrint for InfixNode {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        let mut items = PrettySequence::new(5);
        items.push(self.lhs.pretty(theme));
        items.push(" ");
        items.push(self.operator.pretty(theme));
        items.push(" ");
        items.push(self.rhs.pretty(theme));
        items.into()
    }
}

impl PrettyPrint for PostfixNode {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        self.base.pretty(theme).append(self.operator.pretty(theme))
    }
}