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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
use super::*;

#[cfg(feature = "pretty-print")]
impl PrettyPrint for ApplyCallNode {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        let mut terms = PrettySequence::new(3);
        if let Some(s) = &self.arguments {
            terms += s.pretty(theme)
        }
        terms.into()
    }
}

#[cfg(feature = "lispify")]
impl Lispify for ApplyCallNode {
    type Output = Lisp;

    fn lispify(&self) -> Self::Output {
        let mut lisp = Lisp::new(10);
        lisp += Lisp::keyword("argument");
        match &self.arguments {
            Some(s) => {
                lisp += s.lispify();
            }
            None => {}
        }

        lisp
    }
}

#[cfg(feature = "pretty-print")]
impl PrettyPrint for ArgumentsList {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        PrettyTree::text("(").append(theme.join(self.terms.clone(), ", ")).append(")")
    }
}
#[cfg(feature = "lispify")]
impl Lispify for ArgumentsList {
    type Output = Lisp;

    fn lispify(&self) -> Self::Output {
        let mut lisp = Lisp::new(self.terms.len());
        for term in self.terms.iter() {
            lisp += term.lispify();
        }
        lisp
    }
}
impl Debug for ArgumentTerm {
    fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
        let w = &mut f.debug_struct("ArgumentTerm");
        if !self.modifiers.is_empty() {
            w.field("modifiers", &self.modifiers);
        }
        w.field("key", &self.key).field("value", &self.value).finish()
    }
}

#[cfg(feature = "pretty-print")]
impl PrettyPrint for ArgumentTerm {
    fn pretty(&self, _: &PrettyProvider) -> PrettyTree {
        todo!()
    }
}

#[cfg(feature = "lispify")]
impl Lispify for ArgumentTerm {
    type Output = Lisp;

    fn lispify(&self) -> Self::Output {
        todo!()
    }
}
impl Debug for ArgumentKey {
    fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
        match self {
            Self::Nothing => write!(f, "Nothing"),
            Self::Symbol(node) => Debug::fmt(node, f),
        }
    }
}
#[cfg(feature = "pretty-print")]
impl PrettyPrint for ArgumentKey {
    fn pretty(&self, theme: &PrettyProvider) -> PrettyTree {
        let mods = self.modifiers.pretty(theme);
        let key = theme.argument(self.key.name.clone(), false);
        mods.append(key)
    }
}