use std::{rc::Rc, sync::LazyLock}; use super::{Environment, Node, NodeEnum, Precedence}; #[derive(Debug, Clone, PartialEq, PartialOrd)] pub struct Empty; impl Node for Empty { fn evaluate(&self, _: &mut Environment) -> Result, String> { Ok(Empty::EMPTY.clone()) } fn as_string(&self, _: Option<&Environment>) -> String { String::from("{{#VOID}}") } fn precedence(&self) -> Precedence { Precedence::Empty } } impl Empty { pub const EMPTY: LazyLock> = LazyLock::new(|| Rc::new(Empty{}.into())); }