pub enum Sexp {
Literal(Literal, Span),
Atom(String, Span),
List(Vec<Sexp>, Span),
}Variants§
Implementations§
Source§impl Sexp
impl Sexp
pub fn span(&self) -> Span
pub fn expect_uint<UInt: TryFrom<u64>>( &self, e: &'static str, ) -> Result<UInt, ParseError>
pub fn expect_string(&self, e: &'static str) -> Result<String, ParseError>
pub fn expect_atom(&self, e: &'static str) -> Result<String, ParseError>
pub fn expect_list(&self, e: &'static str) -> Result<&[Sexp], ParseError>
pub fn expect_call( &self, e: &'static str, ) -> Result<(String, &[Sexp], Span), ParseError>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more