Enum valkyrie_ast::ExpressionKind
source · pub enum ExpressionKind {
Show 29 variants
Placeholder,
Null(Box<NullNode>),
Boolean(Box<BooleanNode>),
Lambda(Box<LambdaNode>),
Slot(Box<LambdaSlotNode>),
Symbol(Box<NamePathNode>),
Number(Box<NumberLiteralNode>),
Text(Box<StringTextNode>),
String(Box<StringLiteralNode>),
Formatted(Box<FormatterNode>),
New(Box<ConstructNewNode>),
Object(Box<ConstructObjectNode>),
Unary(Box<UnaryNode>),
Infix(Box<BinaryNode>),
Tuple(Box<TupleNode>),
Array(Box<RangeNode>),
If(Box<IfStatement>),
IfLet(Box<GuardStatement>),
Switch(Box<SwitchStatement>),
Match(Box<MatchStatement>),
Try(Box<TryStatement>),
Procedural(Box<ProceduralNode>),
ApplyCall(Box<ApplyCallNode>),
ClosureCall(Box<ClosureCallNode>),
SubscriptCall(Box<SubscriptCallNode>),
GenericCall(Box<GenericCallNode>),
DotCall(Box<DotCallNode>),
DotMatchCall(Box<MatchCallNode>),
OutputReference(Box<OutputNode>),
}Expand description
The base expression type
Variants§
Placeholder
- Placeholder expression
Null(Box<NullNode>)
- Atomic expression
Boolean(Box<BooleanNode>)
- Atomic expression
Lambda(Box<LambdaNode>)
- Atomic expression
Slot(Box<LambdaSlotNode>)
- Atomic expression
Symbol(Box<NamePathNode>)
- Atomic expression
Number(Box<NumberLiteralNode>)
- Atomic expression
Text(Box<StringTextNode>)
- Atomic expression
String(Box<StringLiteralNode>)
- Atomic expression
Formatted(Box<FormatterNode>)
- Atomic expression
New(Box<ConstructNewNode>)
- Atomic expression
Object(Box<ConstructObjectNode>)
- Atomic expression
Unary(Box<UnaryNode>)
- Compound expression
Infix(Box<BinaryNode>)
- Compound expression
Tuple(Box<TupleNode>)
- Compound expression
Array(Box<RangeNode>)
- Compound expression
If(Box<IfStatement>)
- Standalone expression
IfLet(Box<GuardStatement>)
- Standalone expression
Switch(Box<SwitchStatement>)
- Standalone expression
Match(Box<MatchStatement>)
- Standalone expression
Try(Box<TryStatement>)
- Standalone expression
Procedural(Box<ProceduralNode>)
@procedural() { }
ApplyCall(Box<ApplyCallNode>)
- Postfix expression
ClosureCall(Box<ClosureCallNode>)
- Postfix expression
SubscriptCall(Box<SubscriptCallNode>)
- Postfix expression
GenericCall(Box<GenericCallNode>)
- Postfix expression
DotCall(Box<DotCallNode>)
- Postfix expression
DotMatchCall(Box<MatchCallNode>)
- Postfix expression
OutputReference(Box<OutputNode>)
- REPL Reference
Implementations§
source§impl ExpressionKind
impl ExpressionKind
sourcepub fn binary(o: OperatorNode, lhs: Self, rhs: Self) -> Self
pub fn binary(o: OperatorNode, lhs: Self, rhs: Self) -> Self
Build a new binary expression
sourcepub fn prefix(o: OperatorNode, rhs: Self) -> Self
pub fn prefix(o: OperatorNode, rhs: Self) -> Self
Build a new prefix expression
sourcepub fn suffix(o: OperatorNode, lhs: Self) -> Self
pub fn suffix(o: OperatorNode, lhs: Self) -> Self
Build a new suffix expression
Trait Implementations§
source§impl Clone for ExpressionKind
impl Clone for ExpressionKind
source§fn clone(&self) -> ExpressionKind
fn clone(&self) -> ExpressionKind
Returns a copy 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 ExpressionKind
impl Debug for ExpressionKind
source§impl Default for ExpressionKind
impl Default for ExpressionKind
source§impl From<ApplyCallNode> for ExpressionKind
impl From<ApplyCallNode> for ExpressionKind
source§fn from(o: ApplyCallNode) -> Self
fn from(o: ApplyCallNode) -> Self
Converts to this type from the input type.
source§impl From<BinaryNode> for ExpressionKind
impl From<BinaryNode> for ExpressionKind
source§fn from(o: BinaryNode) -> Self
fn from(o: BinaryNode) -> Self
Converts to this type from the input type.
source§impl From<BooleanNode> for ExpressionKind
impl From<BooleanNode> for ExpressionKind
source§fn from(o: BooleanNode) -> Self
fn from(o: BooleanNode) -> Self
Converts to this type from the input type.
source§impl From<ClosureCallNode> for ExpressionKind
impl From<ClosureCallNode> for ExpressionKind
source§fn from(o: ClosureCallNode) -> Self
fn from(o: ClosureCallNode) -> Self
Converts to this type from the input type.
source§impl From<ConstructNewNode> for ExpressionKind
impl From<ConstructNewNode> for ExpressionKind
source§fn from(o: ConstructNewNode) -> Self
fn from(o: ConstructNewNode) -> Self
Converts to this type from the input type.
source§impl From<ConstructObjectNode> for ExpressionKind
impl From<ConstructObjectNode> for ExpressionKind
source§fn from(o: ConstructObjectNode) -> Self
fn from(o: ConstructObjectNode) -> Self
Converts to this type from the input type.
source§impl From<DotCallNode> for ExpressionKind
impl From<DotCallNode> for ExpressionKind
source§fn from(o: DotCallNode) -> Self
fn from(o: DotCallNode) -> Self
Converts to this type from the input type.
source§impl From<FormatterNode> for ExpressionKind
impl From<FormatterNode> for ExpressionKind
source§fn from(o: FormatterNode) -> Self
fn from(o: FormatterNode) -> Self
Converts to this type from the input type.
source§impl From<GenericCallNode> for ExpressionKind
impl From<GenericCallNode> for ExpressionKind
source§fn from(o: GenericCallNode) -> Self
fn from(o: GenericCallNode) -> Self
Converts to this type from the input type.
source§impl From<GuardStatement> for ExpressionKind
impl From<GuardStatement> for ExpressionKind
source§fn from(o: GuardStatement) -> Self
fn from(o: GuardStatement) -> Self
Converts to this type from the input type.
source§impl From<IfStatement> for ExpressionKind
impl From<IfStatement> for ExpressionKind
source§fn from(o: IfStatement) -> Self
fn from(o: IfStatement) -> Self
Converts to this type from the input type.
source§impl From<LambdaNode> for ExpressionKind
impl From<LambdaNode> for ExpressionKind
source§fn from(o: LambdaNode) -> Self
fn from(o: LambdaNode) -> Self
Converts to this type from the input type.
source§impl From<LambdaSlotNode> for ExpressionKind
impl From<LambdaSlotNode> for ExpressionKind
source§fn from(o: LambdaSlotNode) -> Self
fn from(o: LambdaSlotNode) -> Self
Converts to this type from the input type.
source§impl From<MatchCallNode> for ExpressionKind
impl From<MatchCallNode> for ExpressionKind
source§fn from(o: MatchCallNode) -> Self
fn from(o: MatchCallNode) -> Self
Converts to this type from the input type.
source§impl From<MatchStatement> for ExpressionKind
impl From<MatchStatement> for ExpressionKind
source§fn from(o: MatchStatement) -> Self
fn from(o: MatchStatement) -> Self
Converts to this type from the input type.
source§impl From<NamePathNode> for ExpressionKind
impl From<NamePathNode> for ExpressionKind
source§fn from(o: NamePathNode) -> Self
fn from(o: NamePathNode) -> Self
Converts to this type from the input type.
source§impl From<NullNode> for ExpressionKind
impl From<NullNode> for ExpressionKind
source§impl From<NumberLiteralNode> for ExpressionKind
impl From<NumberLiteralNode> for ExpressionKind
source§fn from(o: NumberLiteralNode) -> Self
fn from(o: NumberLiteralNode) -> Self
Converts to this type from the input type.
source§impl From<OutputNode> for ExpressionKind
impl From<OutputNode> for ExpressionKind
source§fn from(o: OutputNode) -> Self
fn from(o: OutputNode) -> Self
Converts to this type from the input type.
source§impl From<ProceduralNode> for ExpressionKind
impl From<ProceduralNode> for ExpressionKind
source§fn from(o: ProceduralNode) -> Self
fn from(o: ProceduralNode) -> Self
Converts to this type from the input type.
source§impl From<RangeNode> for ExpressionKind
impl From<RangeNode> for ExpressionKind
source§impl From<StringLiteralNode> for ExpressionKind
impl From<StringLiteralNode> for ExpressionKind
source§fn from(o: StringLiteralNode) -> Self
fn from(o: StringLiteralNode) -> Self
Converts to this type from the input type.
source§impl From<StringTextNode> for ExpressionKind
impl From<StringTextNode> for ExpressionKind
source§fn from(o: StringTextNode) -> Self
fn from(o: StringTextNode) -> Self
Converts to this type from the input type.
source§impl From<SubscriptCallNode> for ExpressionKind
impl From<SubscriptCallNode> for ExpressionKind
source§fn from(o: SubscriptCallNode) -> Self
fn from(o: SubscriptCallNode) -> Self
Converts to this type from the input type.
source§impl From<SwitchStatement> for ExpressionKind
impl From<SwitchStatement> for ExpressionKind
source§fn from(o: SwitchStatement) -> Self
fn from(o: SwitchStatement) -> Self
Converts to this type from the input type.
source§impl From<TryStatement> for ExpressionKind
impl From<TryStatement> for ExpressionKind
source§fn from(o: TryStatement) -> Self
fn from(o: TryStatement) -> Self
Converts to this type from the input type.
source§impl From<TupleNode> for ExpressionKind
impl From<TupleNode> for ExpressionKind
source§impl From<UnaryNode> for ExpressionKind
impl From<UnaryNode> for ExpressionKind
source§impl Hash for ExpressionKind
impl Hash for ExpressionKind
source§impl PartialEq for ExpressionKind
impl PartialEq for ExpressionKind
source§fn eq(&self, other: &ExpressionKind) -> bool
fn eq(&self, other: &ExpressionKind) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl ValkyrieNode for ExpressionKind
impl ValkyrieNode for ExpressionKind
impl Eq for ExpressionKind
impl StructuralPartialEq for ExpressionKind
Auto Trait Implementations§
impl RefUnwindSafe for ExpressionKind
impl Send for ExpressionKind
impl Sync for ExpressionKind
impl Unpin for ExpressionKind
impl UnwindSafe for ExpressionKind
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