Enum moore_svlog::hir::ExprKind[][src]

pub enum ExprKind<'a> {
Show 22 variants IntConst { width: usize, value: BigInt, signed: bool, special_bits: BitVec, x_bits: BitVec, }, UnsizedConst(char), TimeConst(BigRational), StringConst(Spanned<Name>), Ident(Spanned<Name>), Unary(UnaryOpNodeId), Binary(BinaryOpNodeIdNodeId), Field(NodeIdSpanned<Name>), Index(NodeIdIndexMode), Builtin(BuiltinCall<'a>), Ternary(NodeIdNodeIdNodeId), Scope(NodeIdSpanned<Name>), PositionalPattern(Vec<NodeId>), NamedPattern(Vec<(PatternMapping, NodeId)>), RepeatPattern(NodeIdVec<NodeId>), Concat(Option<NodeId>, Vec<NodeId>), Cast(NodeIdNodeId), CastSign(Spanned<Sign>, NodeId), CastSize(NodeIdNodeId), Inside(NodeIdVec<Spanned<InsideRange>>), FunctionCall(NodeIdVec<CallArg>), Assign { op: AssignOp, lhs: &'a Expr<'a>, rhs: &'a Expr<'a>, },
}
Expand description

The different forms an expression can take.

Variants

IntConst

An integer constant literal such as 42 or 'd42 or 32'd42.

The special_bits mask keeps track of which bits in the number are x or z. The x_bits mask tracks which of these special bits are x.

Fields of IntConst

width: usizevalue: BigIntsigned: boolspecial_bits: BitVecx_bits: BitVec
UnsizedConst(char)

An unsized and unbased constant literal such as '0.

Tuple Fields of UnsizedConst

0: char
TimeConst(BigRational)

A time constant literal.

Tuple Fields of TimeConst

0: BigRational
StringConst(Spanned<Name>)

A string constant literal.

Tuple Fields of StringConst

0: Spanned<Name>
Ident(Spanned<Name>)

An identifier.

Tuple Fields of Ident

0: Spanned<Name>
Unary(UnaryOpNodeId)

A unary operator.

Tuple Fields of Unary

0: UnaryOp1: NodeId
Binary(BinaryOpNodeIdNodeId)

A binary operator.

Tuple Fields of Binary

0: BinaryOp1: NodeId2: NodeId
Field(NodeIdSpanned<Name>)

A field access such as a.b.

Tuple Fields of Field

0: NodeId1: Spanned<Name>
Index(NodeIdIndexMode)

An index access such as a[b] or a[b:c].

Tuple Fields of Index

0: NodeId1: IndexMode
Builtin(BuiltinCall<'a>)

A builtin function call such as $clog2(x).

Tuple Fields of Builtin

0: BuiltinCall<'a>
Ternary(NodeIdNodeIdNodeId)

A ternary expression such as a ? b : c.

Tuple Fields of Ternary

0: NodeId1: NodeId2: NodeId
Scope(NodeIdSpanned<Name>)

A scope expression such as foo::bar.

Tuple Fields of Scope

0: NodeId1: Spanned<Name>
PositionalPattern(Vec<NodeId>)

A positional pattern such as '{a, b, c}.

Tuple Fields of PositionalPattern

0: Vec<NodeId>
NamedPattern(Vec<(PatternMapping, NodeId)>)

A named pattern such as '{logic: a, foo: b, 31: c, default: d}.

Tuple Fields of NamedPattern

0: Vec<(PatternMapping, NodeId)>
RepeatPattern(NodeIdVec<NodeId>)

A repeat pattern such as '{32{a, b, c}}.

Tuple Fields of RepeatPattern

0: NodeId1: Vec<NodeId>
Concat(Option<NodeId>, Vec<NodeId>)

A concatenation such as {a,b} or {4{a,b}}.

Tuple Fields of Concat

0: Option<NodeId>1: Vec<NodeId>
Cast(NodeIdNodeId)

A cast (ty, expr) such as foo'(bar).

Tuple Fields of Cast

0: NodeId1: NodeId
CastSign(Spanned<Sign>, NodeId)

A sign cast such as unsigned'(foo).

Tuple Fields of CastSign

0: Spanned<Sign>1: NodeId
CastSize(NodeIdNodeId)

A size cast (size_expr, expr) such as 42'(foo).

Tuple Fields of CastSize

0: NodeId1: NodeId

An inside expression such as a inside {b, c}.

Tuple Fields of Inside

0: NodeId1: Vec<Spanned<InsideRange>>
FunctionCall(NodeIdVec<CallArg>)

A function call such as foo(a, b, c).

Tuple Fields of FunctionCall

0: NodeId1: Vec<CallArg>
Assign

An assignment.

Fields of Assign

op: AssignOplhs: &'a Expr<'a>rhs: &'a Expr<'a>

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

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)

recently added

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.