pub enum Sexp {
Num(i64),
Sym(SmolStr),
List(Vec<Sexp>),
Nil,
}Expand description
A read s-expression — the concrete syntax tree, before lowering.
Unlike Exp and crate::core::Val, lists here are flat
Vec<Sexp>, which is what the shape-matching in lowering wants.
Variants§
Num(i64)
Integer atom: a maximal symbol-char run matching -?[0-9]+.
Sym(SmolStr)
Symbol atom. SmolStr: inline storage for strings ≤22 bytes (all common symbol names).
List(Vec<Sexp>)
Parenthesized list.
Nil
The atom nil, classified at read time.
Trait Implementations§
impl StructuralPartialEq for Sexp
Auto Trait Implementations§
impl Freeze for Sexp
impl RefUnwindSafe for Sexp
impl Send for Sexp
impl Sync for Sexp
impl Unpin for Sexp
impl UnwindSafe for Sexp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more