Enum ExprKind

Source
pub enum ExprKind {
Show 39 variants Constant(Value), Module { name: ArcStr, export: bool, value: ModuleKind, }, Do { exprs: Arc<[Expr]>, }, Use { name: ModPath, }, Bind(Arc<Bind>), Ref { name: ModPath, }, Connect { name: ModPath, value: Arc<Expr>, }, StringInterpolate { args: Arc<[Expr]>, }, StructRef { source: Arc<Expr>, field: ArcStr, }, TupleRef { source: Arc<Expr>, field: usize, }, ArrayRef { source: Arc<Expr>, i: Arc<Expr>, }, ArraySlice { source: Arc<Expr>, start: Option<Arc<Expr>>, end: Option<Arc<Expr>>, }, StructWith { source: Arc<Expr>, replace: Arc<[(ArcStr, Expr)]>, }, Lambda(Arc<Lambda>), TypeDef { name: ArcStr, params: Arc<[(TVar, Option<Type>)]>, typ: Type, }, TypeCast { expr: Arc<Expr>, typ: Type, }, Apply { args: Arc<[(Option<ArcStr>, Expr)]>, function: Arc<Expr>, }, Any { args: Arc<[Expr]>, }, Array { args: Arc<[Expr]>, }, Tuple { args: Arc<[Expr]>, }, Variant { tag: ArcStr, args: Arc<[Expr]>, }, Struct { args: Arc<[(ArcStr, Expr)]>, }, Select { arg: Arc<Expr>, arms: Arc<[(Pattern, Expr)]>, }, Qop(Arc<Expr>), ByRef(Arc<Expr>), Deref(Arc<Expr>), Eq { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Ne { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Lt { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Gt { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Lte { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Gte { lhs: Arc<Expr>, rhs: Arc<Expr>, }, And { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Or { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Not { expr: Arc<Expr>, }, Add { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Sub { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Mul { lhs: Arc<Expr>, rhs: Arc<Expr>, }, Div { lhs: Arc<Expr>, rhs: Arc<Expr>, },
}

Variants§

§

Constant(Value)

§

Module

Fields

§name: ArcStr
§export: bool
§

Do

Fields

§exprs: Arc<[Expr]>
§

Use

Fields

§name: ModPath
§

Bind(Arc<Bind>)

§

Ref

Fields

§name: ModPath
§

Connect

Fields

§name: ModPath
§value: Arc<Expr>
§

StringInterpolate

Fields

§args: Arc<[Expr]>
§

StructRef

Fields

§source: Arc<Expr>
§field: ArcStr
§

TupleRef

Fields

§source: Arc<Expr>
§field: usize
§

ArrayRef

Fields

§source: Arc<Expr>
§

ArraySlice

Fields

§source: Arc<Expr>
§start: Option<Arc<Expr>>
§

StructWith

Fields

§source: Arc<Expr>
§replace: Arc<[(ArcStr, Expr)]>
§

Lambda(Arc<Lambda>)

§

TypeDef

Fields

§name: ArcStr
§params: Arc<[(TVar, Option<Type>)]>
§typ: Type
§

TypeCast

Fields

§expr: Arc<Expr>
§typ: Type
§

Apply

Fields

§args: Arc<[(Option<ArcStr>, Expr)]>
§function: Arc<Expr>
§

Any

Fields

§args: Arc<[Expr]>
§

Array

Fields

§args: Arc<[Expr]>
§

Tuple

Fields

§args: Arc<[Expr]>
§

Variant

Fields

§args: Arc<[Expr]>
§

Struct

Fields

§args: Arc<[(ArcStr, Expr)]>
§

Select

Fields

§arg: Arc<Expr>
§arms: Arc<[(Pattern, Expr)]>
§

Qop(Arc<Expr>)

§

ByRef(Arc<Expr>)

§

Deref(Arc<Expr>)

§

Eq

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Ne

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Lt

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Gt

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Lte

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Gte

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

And

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Or

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Not

Fields

§expr: Arc<Expr>
§

Add

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Sub

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Mul

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>
§

Div

Fields

§lhs: Arc<Expr>
§rhs: Arc<Expr>

Implementations§

Source§

impl ExprKind

Source

pub fn to_expr(self, pos: SourcePosition) -> Expr

Source

pub fn to_expr_nopos(self) -> Expr

does not provide any position information or comment

Source

pub fn to_string_pretty(&self, col_limit: 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§

const 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 Display for ExprKind

Source§

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

Formats the value using the given formatter. Read more
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 PartialOrd for ExprKind

Source§

fn partial_cmp(&self, other: &ExprKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V