pub enum Expr<'a, 'f> {
    Const(ConstValue),
    Ident(Ident<'a, 'f>),
    Unary(Spanned<'f, UnaryOp>, Spanned<'f, Box<Expr<'a, 'f>>>),
    Binary(Spanned<'f, BinaryOp>, Spanned<'f, Box<Expr<'a, 'f>>>, Spanned<'f, Box<Expr<'a, 'f>>>),
    NAry(NAryOpSpanned<'f, Vec<Spanned<'f, Expr<'a, 'f>>>>),
    Slice(Spanned<'f, Box<Expr<'a, 'f>>>, Spanned<'f, Box<Expr<'a, 'f>>>, Spanned<'f, Box<Expr<'a, 'f>>>, Option<Spanned<'f, Box<Expr<'a, 'f>>>>),
    Ternary {
        op: TernaryOp,
        condition: Spanned<'f, Box<Expr<'a, 'f>>>,
        then: Spanned<'f, Box<Expr<'a, 'f>>>,
        otherwise: Spanned<'f, Box<Expr<'a, 'f>>>,
    },
    NamedClock(Spanned<'f, ClockExpr<'a, 'f>>),
    CallByName(Spanned<'f, Ident<'a, 'f>>, Vec<Spanned<'f, StaticArg<'a, 'f>>>, Vec<Spanned<'f, Expr<'a, 'f>>>),
    CreateStruct {
        ty_name: Spanned<'f, Ident<'a, 'f>>,
        fields: Vec<(Spanned<'f, Ident<'a, 'f>>, Spanned<'f, Expr<'a, 'f>>)>,
        base_value: Option<Spanned<'f, Box<Expr<'a, 'f>>>>,
    },
    Merge(Spanned<'f, Ident<'a, 'f>>, Vec<Spanned<'f, MergeCase<'a, 'f>>>),
    CallByPos(Spanned<'f, (Spanned<'f, Ident<'a, 'f>>, Vec<StaticArg<'a, 'f>>)>, Vec<Spanned<'f, Expr<'a, 'f>>>),
}
Expand description

An expression

Variants

Const(ConstValue)

Tuple Fields

Constant value

Ident(Ident<'a, 'f>)

Tuple Fields

0: Ident<'a, 'f>

Identifier

Unary(Spanned<'f, UnaryOp>, Spanned<'f, Box<Expr<'a, 'f>>>)

Tuple Fields

0: Spanned<'f, UnaryOp>

Operator

1: Spanned<'f, Box<Expr<'a, 'f>>>

Operand

Unary operation

Binary(Spanned<'f, BinaryOp>, Spanned<'f, Box<Expr<'a, 'f>>>, Spanned<'f, Box<Expr<'a, 'f>>>)

Tuple Fields

0: Spanned<'f, BinaryOp>

Operator

1: Spanned<'f, Box<Expr<'a, 'f>>>

LHS

2: Spanned<'f, Box<Expr<'a, 'f>>>

RHS

Binary operation

NAry(NAryOpSpanned<'f, Vec<Spanned<'f, Expr<'a, 'f>>>>)

Tuple Fields

0: NAryOp

Operator

1: Spanned<'f, Vec<Spanned<'f, Expr<'a, 'f>>>>

Operands

N-ary operation

Slice(Spanned<'f, Box<Expr<'a, 'f>>>, Spanned<'f, Box<Expr<'a, 'f>>>, Spanned<'f, Box<Expr<'a, 'f>>>, Option<Spanned<'f, Box<Expr<'a, 'f>>>>)

Tuple Fields

0: Spanned<'f, Box<Expr<'a, 'f>>>

Array

1: Spanned<'f, Box<Expr<'a, 'f>>>

Start

2: Spanned<'f, Box<Expr<'a, 'f>>>

End

3: Option<Spanned<'f, Box<Expr<'a, 'f>>>>

Step

Slice access (tab[x..y])

Ternary

Fields

op: TernaryOp

Operator

condition: Spanned<'f, Box<Expr<'a, 'f>>>

Condition

then: Spanned<'f, Box<Expr<'a, 'f>>>

Value if the condition is true

otherwise: Spanned<'f, Box<Expr<'a, 'f>>>

Value if the condition is false

Ternary expression

NamedClock(Spanned<'f, ClockExpr<'a, 'f>>)

Tuple Fields

0: Spanned<'f, ClockExpr<'a, 'f>>

A clock expression

CallByName(Spanned<'f, Ident<'a, 'f>>, Vec<Spanned<'f, StaticArg<'a, 'f>>>, Vec<Spanned<'f, Expr<'a, 'f>>>)

Tuple Fields

0: Spanned<'f, Ident<'a, 'f>>

The name of the node

1: Vec<Spanned<'f, StaticArg<'a, 'f>>>

The static arguments

2: Vec<Spanned<'f, Expr<'a, 'f>>>

The dynamic arguments

Node call

Not sure what the difference with Expr::CallByPos is… TODO

CreateStruct

Fields

ty_name: Spanned<'f, Ident<'a, 'f>>

Type name

fields: Vec<(Spanned<'f, Ident<'a, 'f>>, Spanned<'f, Expr<'a, 'f>>)>

Fields (name and value)

base_value: Option<Spanned<'f, Box<Expr<'a, 'f>>>>

Base structure (fields that are not specified will be copied from this structure)

Structure creation

Merge(Spanned<'f, Ident<'a, 'f>>, Vec<Spanned<'f, MergeCase<'a, 'f>>>)

Tuple Fields

0: Spanned<'f, Ident<'a, 'f>>

Not sure what that is TODO

1: Vec<Spanned<'f, MergeCase<'a, 'f>>>

The different cases of the merge

Merge operation

CallByPos(Spanned<'f, (Spanned<'f, Ident<'a, 'f>>, Vec<StaticArg<'a, 'f>>)>, Vec<Spanned<'f, Expr<'a, 'f>>>)

Tuple Fields

0: Spanned<'f, (Spanned<'f, Ident<'a, 'f>>, Vec<StaticArg<'a, 'f>>)>

The node name and its static arguments

TODO: shouldn’t that be two different fields?

1: Vec<Spanned<'f, Expr<'a, 'f>>>

The dynamic arguments

Node call

Not sure what the difference with Expr::CallByName is… TODO

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.