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

impl PrettyPrint for LambdaCallNode {
    fn build<'a>(&self, allocator: &'a PrettyProvider<'a>) -> PrettyTree<'a> {
        let mut terms = Vec::with_capacity(6);
        terms.push(allocator.space());
        terms.push(allocator.text("{"));
        terms.push(allocator.hardline());
        terms.push(allocator.intersperse(&self.body, allocator.hardline()).indent(4));
        terms.push(allocator.hardline());
        terms.push(allocator.text("}"));
        allocator.concat(terms)
    }
}

impl PrettyPrint for LambdaDotNode {
    fn build<'a>(&self, allocator: &'a PrettyProvider<'a>) -> PrettyTree<'a> {
        let newline = allocator.hardline();
        let mut terms = Vec::with_capacity(6);
        terms.push(allocator.text("."));
        terms.push(allocator.text("{"));
        terms.push(allocator.space());
        terms.push(allocator.join(&self.body, ";"));
        terms.push(allocator.space());
        terms.push(allocator.text("}"));
        newline.append(allocator.concat(terms).indent(4))
    }
}