pub enum Expression {
Show 28 variants
Identifier(Loc<Path>),
IntLiteral(Loc<IntLiteral>),
BoolLiteral(Loc<bool>),
StrLiteral(Loc<String>),
TriLiteral(Loc<BitLiteral>),
ArrayLiteral(Vec<Loc<Expression>>),
ArrayShorthandLiteral(Box<Loc<Expression>>, Box<Loc<Expression>>),
Index(Box<Loc<Expression>>, Box<Loc<Expression>>),
RangeIndex {
target: Box<Loc<Expression>>,
start: Box<Loc<Expression>>,
end: Box<Loc<Expression>>,
},
Parenthesized(Box<Loc<Expression>>),
TupleLiteral(Vec<Loc<Expression>>),
TupleIndex(Box<Loc<Expression>>, Loc<u128>),
FieldAccess(Box<Loc<Expression>>, Loc<Identifier>),
CreatePorts,
Lambda {
unit_kind: Loc<UnitKind>,
args: Loc<Vec<Loc<Pattern>>>,
body: Box<Loc<Block>>,
},
Call {
kind: CallKind,
callee: Loc<Path>,
args: Loc<ArgumentList>,
turbofish: Option<Loc<TurbofishInner>>,
},
MethodCall {
target: Box<Loc<Expression>>,
name: Loc<Identifier>,
args: Loc<ArgumentList>,
kind: CallKind,
turbofish: Option<Loc<TurbofishInner>>,
},
If(Box<Loc<Expression>>, Box<Loc<Expression>>, Box<Loc<Expression>>),
TypeLevelIf(Box<Loc<Expression>>, Box<Loc<Expression>>, Box<Loc<Expression>>),
Match(Box<Loc<Expression>>, Loc<Vec<(Loc<Pattern>, Loc<Expression>)>>),
UnaryOperator(Loc<UnaryOperator>, Box<Loc<Expression>>),
BinaryOperator(Box<Loc<Expression>>, Loc<BinaryOperator>, Box<Loc<Expression>>),
Block(Box<Block>),
Unsafe(Box<Loc<Block>>),
PipelineReference {
stage_kw_and_reference_loc: Loc<()>,
stage: PipelineStageReference,
name: Loc<Identifier>,
},
StageValid,
StageReady,
StaticUnreachable(Loc<String>),
}Variants§
Identifier(Loc<Path>)
IntLiteral(Loc<IntLiteral>)
BoolLiteral(Loc<bool>)
StrLiteral(Loc<String>)
TriLiteral(Loc<BitLiteral>)
ArrayLiteral(Vec<Loc<Expression>>)
[1, 2, 3]
ArrayShorthandLiteral(Box<Loc<Expression>>, Box<Loc<Expression>>)
[<expr>; <amount>]
amount is a const generic
Index(Box<Loc<Expression>>, Box<Loc<Expression>>)
RangeIndex
Parenthesized(Box<Loc<Expression>>)
TupleLiteral(Vec<Loc<Expression>>)
TupleIndex(Box<Loc<Expression>>, Loc<u128>)
FieldAccess(Box<Loc<Expression>>, Loc<Identifier>)
CreatePorts
Lambda
Call
MethodCall
Fields
§
target: Box<Loc<Expression>>§
name: Loc<Identifier>§
args: Loc<ArgumentList>§
turbofish: Option<Loc<TurbofishInner>>If(Box<Loc<Expression>>, Box<Loc<Expression>>, Box<Loc<Expression>>)
TypeLevelIf(Box<Loc<Expression>>, Box<Loc<Expression>>, Box<Loc<Expression>>)
Match(Box<Loc<Expression>>, Loc<Vec<(Loc<Pattern>, Loc<Expression>)>>)
UnaryOperator(Loc<UnaryOperator>, Box<Loc<Expression>>)
BinaryOperator(Box<Loc<Expression>>, Loc<BinaryOperator>, Box<Loc<Expression>>)
Block(Box<Block>)
Unsafe(Box<Loc<Block>>)
PipelineReference
E.g. stage(-5).x, stage('b).y
StageValid
StageReady
StaticUnreachable(Loc<String>)
Implementations§
Source§impl Expression
impl Expression
pub fn int_literal_signed(val: i32) -> Self
pub fn bool_literal(val: bool) -> Self
pub fn as_int_literal(self) -> Option<IntLiteral>
pub fn assume_block(&self) -> &Block
pub fn variant_str(&self) -> &'static str
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more