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

source

pub fn binary(o: OperatorNode, lhs: Self, rhs: Self) -> Self

Build a new binary expression

source

pub fn prefix(o: OperatorNode, rhs: Self) -> Self

Build a new prefix expression

source

pub fn suffix(o: OperatorNode, lhs: Self) -> Self

Build a new suffix expression

Trait Implementations§

source§

impl Clone for ExpressionKind

source§

fn clone(&self) -> ExpressionKind

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ExpressionKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for ExpressionKind

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<ApplyCallNode> for ExpressionKind

source§

fn from(o: ApplyCallNode) -> Self

Converts to this type from the input type.
source§

impl From<BinaryNode> for ExpressionKind

source§

fn from(o: BinaryNode) -> Self

Converts to this type from the input type.
source§

impl From<BooleanNode> for ExpressionKind

source§

fn from(o: BooleanNode) -> Self

Converts to this type from the input type.
source§

impl From<ClosureCallNode> for ExpressionKind

source§

fn from(o: ClosureCallNode) -> Self

Converts to this type from the input type.
source§

impl From<ConstructNewNode> for ExpressionKind

source§

fn from(o: ConstructNewNode) -> Self

Converts to this type from the input type.
source§

impl From<ConstructObjectNode> for ExpressionKind

source§

fn from(o: ConstructObjectNode) -> Self

Converts to this type from the input type.
source§

impl From<DotCallNode> for ExpressionKind

source§

fn from(o: DotCallNode) -> Self

Converts to this type from the input type.
source§

impl From<FormatterNode> for ExpressionKind

source§

fn from(o: FormatterNode) -> Self

Converts to this type from the input type.
source§

impl From<GenericCallNode> for ExpressionKind

source§

fn from(o: GenericCallNode) -> Self

Converts to this type from the input type.
source§

impl From<GuardStatement> for ExpressionKind

source§

fn from(o: GuardStatement) -> Self

Converts to this type from the input type.
source§

impl From<IfStatement> for ExpressionKind

source§

fn from(o: IfStatement) -> Self

Converts to this type from the input type.
source§

impl From<LambdaNode> for ExpressionKind

source§

fn from(o: LambdaNode) -> Self

Converts to this type from the input type.
source§

impl From<LambdaSlotNode> for ExpressionKind

source§

fn from(o: LambdaSlotNode) -> Self

Converts to this type from the input type.
source§

impl From<MatchCallNode> for ExpressionKind

source§

fn from(o: MatchCallNode) -> Self

Converts to this type from the input type.
source§

impl From<MatchStatement> for ExpressionKind

source§

fn from(o: MatchStatement) -> Self

Converts to this type from the input type.
source§

impl From<NamePathNode> for ExpressionKind

source§

fn from(o: NamePathNode) -> Self

Converts to this type from the input type.
source§

impl From<NullNode> for ExpressionKind

source§

fn from(o: NullNode) -> Self

Converts to this type from the input type.
source§

impl From<NumberLiteralNode> for ExpressionKind

source§

fn from(o: NumberLiteralNode) -> Self

Converts to this type from the input type.
source§

impl From<OutputNode> for ExpressionKind

source§

fn from(o: OutputNode) -> Self

Converts to this type from the input type.
source§

impl From<ProceduralNode> for ExpressionKind

source§

fn from(o: ProceduralNode) -> Self

Converts to this type from the input type.
source§

impl From<RangeNode> for ExpressionKind

source§

fn from(o: RangeNode) -> Self

Converts to this type from the input type.
source§

impl From<StringLiteralNode> for ExpressionKind

source§

fn from(o: StringLiteralNode) -> Self

Converts to this type from the input type.
source§

impl From<StringTextNode> for ExpressionKind

source§

fn from(o: StringTextNode) -> Self

Converts to this type from the input type.
source§

impl From<SubscriptCallNode> for ExpressionKind

source§

fn from(o: SubscriptCallNode) -> Self

Converts to this type from the input type.
source§

impl From<SwitchStatement> for ExpressionKind

source§

fn from(o: SwitchStatement) -> Self

Converts to this type from the input type.
source§

impl From<TryStatement> for ExpressionKind

source§

fn from(o: TryStatement) -> Self

Converts to this type from the input type.
source§

impl From<TupleNode> for ExpressionKind

source§

fn from(o: TupleNode) -> Self

Converts to this type from the input type.
source§

impl From<UnaryNode> for ExpressionKind

source§

fn from(o: UnaryNode) -> Self

Converts to this type from the input type.
source§

impl Hash for ExpressionKind

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

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

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for ExpressionKind

source§

fn eq(&self, other: &ExpressionKind) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl ValkyrieNode for ExpressionKind

source§

fn get_range(&self) -> Range<usize>

The range of the node
source§

fn get_start(&self) -> usize

Get the start of the node
source§

fn get_end(&self) -> usize

Get the end of the node
source§

impl Eq for ExpressionKind

source§

impl StructuralPartialEq for ExpressionKind

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.