Skip to main content

ExprKind

Enum ExprKind 

Source
pub enum ExprKind {
Show 14 variants Atom(Atom), If(Box<If>), Let(Box<Let>), Define(Box<Define>), LambdaFunction(Box<LambdaFunction>), Begin(Box<Begin>), Return(Box<Return>), Quote(Box<Quote>), Macro(Box<Macro>), SyntaxRules(Box<SyntaxRules>), List(List), Set(Box<Set>), Require(Box<Require>), Vector(Vector),
}

Variants§

§

Atom(Atom)

§

If(Box<If>)

§

Let(Box<Let>)

§

Define(Box<Define>)

§

LambdaFunction(Box<LambdaFunction>)

§

Begin(Box<Begin>)

§

Return(Box<Return>)

§

Quote(Box<Quote>)

§

Macro(Box<Macro>)

§

SyntaxRules(Box<SyntaxRules>)

§

List(List)

§

Set(Box<Set>)

§

Require(Box<Require>)

§

Vector(Vector)

Implementations§

Source§

impl ExprKind

Source

pub fn span(&self) -> Span

Source

pub fn to_string_literal(&self) -> Option<String>

Source

pub fn into_lambda_function(self) -> Option<Box<LambdaFunction>>

Source

pub fn quoted_list() -> ExprKind

Source

pub fn empty() -> ExprKind

Source

pub fn integer_literal(value: isize, span: Span) -> ExprKind

Source

pub fn atom<T: Into<InternedString>>(name: T) -> ExprKind

Source

pub fn ident(name: &str) -> ExprKind

Source

pub fn ident_with_span(name: &str, span: Span) -> ExprKind

Source

pub fn string_lit(input: String) -> ExprKind

Source

pub fn bool_lit(b: bool) -> ExprKind

Source

pub fn default_if(test: ExprKind, then: ExprKind, els: ExprKind) -> ExprKind

Source

pub fn into_atom_syntax_object(self) -> Option<SyntaxObject>

Source

pub fn atom_syntax_object(&self) -> Option<&SyntaxObject>

Source

pub fn atom_syntax_object_mut(&mut self) -> Option<&mut SyntaxObject>

Source

pub fn define_syntax_ident(&self) -> bool

Source

pub fn atom_identifier_mut(&mut self) -> Option<&mut InternedString>

Source

pub fn lambda_function(&self) -> Option<&LambdaFunction>

Source

pub fn atom_identifier_or_else<E, F: FnOnce() -> E>( &self, err: F, ) -> Result<&InternedString, E>

Source

pub fn atom_identifier(&self) -> Option<&InternedString>

Source

pub fn string_literal(&self) -> Option<&str>

Source

pub fn list(&self) -> Option<&List>

Source

pub fn list_mut(&mut self) -> Option<&mut List>

Source

pub fn list_or_else<E, F: FnOnce() -> E>(&self, err: F) -> Result<&List, E>

Source

pub fn list_mut_or_else<E, F: FnOnce() -> E>( &mut self, err: F, ) -> Result<&mut List, E>

Source

pub fn into_list_or_else<E, F: FnOnce() -> E>(self, err: F) -> Result<List, E>

Source

pub fn into_list(self) -> List

Source

pub fn unwrap_function(self) -> Option<Box<LambdaFunction>>

Source

pub fn get_list(&self) -> Option<&List>

Source

pub fn update_string_in_atom(&mut self, ident: InternedString)

Source§

impl ExprKind

Source

pub fn to_pretty(&self, width: usize) -> String

Trait Implementations§

Source§

impl Clone for ExprKind

Source§

fn clone(&self) -> ExprKind

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExprKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExprKind

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ExprKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for ExprKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Atom> for ExprKind

Source§

fn from(val: Atom) -> Self

Converts to this type from the input type.
Source§

impl From<Begin> for ExprKind

Source§

fn from(val: Begin) -> Self

Converts to this type from the input type.
Source§

impl From<Define> for ExprKind

Source§

fn from(val: Define) -> Self

Converts to this type from the input type.
Source§

impl From<If> for ExprKind

Source§

fn from(val: If) -> Self

Converts to this type from the input type.
Source§

impl From<LambdaFunction> for ExprKind

Source§

fn from(val: LambdaFunction) -> Self

Converts to this type from the input type.
Source§

impl From<Let> for ExprKind

Source§

fn from(val: Let) -> Self

Converts to this type from the input type.
Source§

impl From<List> for ExprKind

Source§

fn from(val: List) -> Self

Converts to this type from the input type.
Source§

impl From<Macro> for ExprKind

Source§

fn from(val: Macro) -> Self

Converts to this type from the input type.
Source§

impl From<Quote> for ExprKind

Source§

fn from(val: Quote) -> Self

Converts to this type from the input type.
Source§

impl From<Require> for ExprKind

Source§

fn from(val: Require) -> Self

Converts to this type from the input type.
Source§

impl From<Return> for ExprKind

Source§

fn from(val: Return) -> Self

Converts to this type from the input type.
Source§

impl From<Set> for ExprKind

Source§

fn from(val: Set) -> Self

Converts to this type from the input type.
Source§

impl From<SyntaxRules> for ExprKind

Source§

fn from(val: SyntaxRules) -> Self

Converts to this type from the input type.
Source§

impl From<Vector> for ExprKind

Source§

fn from(value: Vector) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ExprKind

Source§

fn eq(&self, other: &ExprKind) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ExprKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToDoc for ExprKind

Source§

fn to_doc(&self) -> RcDoc<'_, ()>

Source§

impl TryFrom<ThinVec<ExprKind>> for ExprKind

Source§

type Error = ParseError

The type returned in the event of a conversion error.
Source§

fn try_from(value: ThinVec<ExprKind>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl StructuralPartialEq for ExprKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,