1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::*;

impl PrettyPrint for NumberLiteralNode {
    fn build<'a>(&self, allocator: &'a PrettyProvider<'a>) -> PrettyTree<'a> {
        let num = allocator.number(self.value.to_string());
        match &self.unit {
            Some(s) => {
                let unit = allocator.metadata(s.name.to_string());
                num.append(unit)
            }
            None => num,
        }
    }
}