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
32
33
34
use super::*;

impl PrettyPrint for ModifiersNode {
    fn build<'a>(&self, allocator: &'a PrettyProvider<'a>) -> PrettyTree<'a> {
        let mut items = Vec::with_capacity(2 * self.terms.len());
        for x in &self.terms {
            items.push(allocator.keyword(x.name.to_string()));
            items.push(allocator.space());
        }
        allocator.concat(items)
    }
}

impl PrettyPrint for TaggedDeclaration {
    fn build<'a>(&self, allocator: &'a PrettyProvider<'a>) -> PrettyTree<'a> {
        let mut terms = Vec::with_capacity(8);
        terms.push(self.modifiers.build(allocator));
        terms.push(allocator.keyword("enumerate"));
        terms.push(allocator.space());
        terms.push(self.namepath.build(allocator));
        terms.push(self.statements.build(allocator));
        allocator.concat(terms)
    }
}

impl PrettyPrint for VariantDeclaration {
    fn build<'a>(&self, allocator: &'a PrettyProvider<'a>) -> PrettyTree<'a> {
        let mut terms = Vec::with_capacity(8);
        // terms.push(self.modifiers.build(allocator));
        terms.push(allocator.argument(self.variant.name.to_string(), false));
        terms.push(self.statements.build(allocator));
        allocator.concat(terms)
    }
}