valkyrie-ast 0.1.4

Strong typed abstract syntax tree of valkyrie language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use super::*;

impl PrettyPrint for NumberLiteralNode {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        let num = theme.number(self.value.to_string());
        match &self.unit {
            Some(s) => {
                let unit = theme.annotation(s.name.to_string());
                num.append(unit)
            }
            None => num,
        }
    }
}