use crate::*; use std::sync::Arc; use std::borrow::Cow; #[derive(Debug, Copy, Clone, Default, PartialEq)] pub struct AstIter; impl<'source> From> for AstIter { fn from (source: SourceIter<'source>) -> Self { Self // TODO } } /// Owns its values, and has no metadata. pub type Ast = Value, AstIter>; impl<'source> From> for Ast { fn from (token: CstToken<'source>) -> Self { token.value().into() } } impl<'source> From> for Ast { fn from (value: CstValue<'source>) -> Self { use Value::*; match value { Nil => Nil, Err(e) => Err(e), Num(u) => Num(u), Sym(s) => Sym(s.into()), Key(s) => Key(s.into()), Str(s) => Str(s.into()), Exp(d, x) => Exp(d, x.into()), } } }