use std::collections;
use std::ops;
mod node;
pub(crate) use node::Node;
pub(crate) use node::NumberSign;
mod display;
mod eval;
mod from;
mod references;
mod variable_value;
pub(crate) use variable_value::VariableValue;
type FunctionArgs = Vec<String>;
type FunctionName = String;
type VariableName = String;
pub(crate) type Functions = collections::HashMap<FunctionName, Ast>;
pub(crate) type Variables = collections::HashMap<VariableName, Ast>;
#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct Ast(Box<Node>);
impl Ast {
pub fn new(inner: Node) -> Self {
Self(Box::new(inner))
}
pub fn into_inner(self) -> Node {
*self.0
}
}
impl ops::Deref for Ast {
type Target = Node;
fn deref(&self) -> &Self::Target {
&self.0
}
}