[][src]Enum lark_hir::ExpressionData

pub enum ExpressionData {
    Let {
        variable: Variable,
        initializer: Option<Expression>,
        body: Expression,
    },
    Place {
        place: Place,
    },
    Assignment {
        place: Place,
        value: Expression,
    },
    MethodCall {
        method: Identifier,
        arguments: List<Expression>,
    },
    Call {
        function: Expression,
        arguments: List<Expression>,
    },
    Sequence {
        first: Expression,
        second: Expression,
    },
    If {
        condition: Expression,
        if_true: Expression,
        if_false: Expression,
    },
    Binary {
        operator: BinaryOperator,
        left: Expression,
        right: Expression,
    },
    Unary {
        operator: UnaryOperator,
        value: Expression,
    },
    Literal {
        data: LiteralData,
    },
    Aggregate {
        entity: Entity,
        fields: List<IdentifiedExpression>,
    },
    Unit {},
    Error {
        error: Error,
    },
}

Variants

Let

let <var> = <initializer> in <body>

Fields of Let

variable: Variableinitializer: Option<Expression>body: Expression
Place

reference to a local variable X or a path like X.Y.Z

Fields of Place

place: Place
Assignment

<place> = <value>

Fields of Assignment

place: Placevalue: Expression
MethodCall

<arg0>.method(<arg1..>)

Fields of MethodCall

method: Identifierarguments: List<Expression>
Call

function(<args>)

Fields of Call

function: Expressionarguments: List<Expression>
Sequence

E1; E2

Fields of Sequence

first: Expressionsecond: Expression
If

if E1 { E2 } else { E3 }

Fields of If

condition: Expressionif_true: Expressionif_false: Expression
Binary

E1 (op) E2

Fields of Binary

operator: BinaryOperatorleft: Expressionright: Expression
Unary

(op) E

Fields of Unary

operator: UnaryOperatorvalue: Expression
Literal

A literal value

Fields of Literal

data: LiteralData
Aggregate

Construct a value of some aggregate type, such as a struct or tuple:

  • Struct { field1: expression1, ... fieldN: expressionN }

Fields of Aggregate

entity: Entityfields: List<IdentifiedExpression>
Unit

()

Fields of Unit

Error

Error -- some error condition

Fields of Error

error: Error

Trait Implementations

impl HirIndexData for ExpressionData[src]

type Index = Expression

fn index_vec(hir: &FnBodyTables) -> &IndexVec<Self::Index, Self>[src]

fn index_vec_mut(hir: &mut FnBodyTables) -> &mut IndexVec<Self::Index, Self>[src]

impl Eq for ExpressionData[src]

impl Clone for ExpressionData[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for ExpressionData[src]

impl PartialEq<ExpressionData> for ExpressionData[src]

impl Hash for ExpressionData[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Debug for ExpressionData[src]

impl DebugWith for ExpressionData[src]

fn debug_with<Cx>(&'me self, cx: &'me Cx) -> DebugCxPair<'me, &'me Self, Cx> where
    Cx: ?Sized
[src]

fn into_debug_with<Cx>(self, cx: &'me Cx) -> DebugCxPair<'me, Self, Cx> where
    Cx: ?Sized
[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<Cx, T> FmtWithSpecialized for T where
    Cx: ?Sized,
    T: Debug + ?Sized
[src]

impl<T> Erased for T