[−][src]Enum mc_parser::ast::Expression

pub enum Expression<'a> {
    Literal {
        literal: Literal,
        span: Span<'a>,
    },
    Variable {
        identifier: Identifier<'a>,
        index_expression: Option<Box<Expression<'a>>>,
        span: Span<'a>,
    },
    FunctionCall {
        identifier: Identifier<'a>,
        arguments: Vec<Expression<'a>>,
        span: Span<'a>,
    },
    Unary {
        op: UnaryOp,
        expression: Box<Expression<'a>>,
        span: Span<'a>,
    },
    Binary {
        op: BinaryOp,
        lhs: Box<Expression<'a>>,
        rhs: Box<Expression<'a>>,
        span: Span<'a>,
    },
}

Variants

Literal

Fields of Literal

literal: Literalspan: Span<'a>
Variable

Fields of Variable

identifier: Identifier<'a>index_expression: Option<Box<Expression<'a>>>span: Span<'a>
FunctionCall

Fields of FunctionCall

identifier: Identifier<'a>arguments: Vec<Expression<'a>>span: Span<'a>
Unary

Fields of Unary

op: UnaryOpexpression: Box<Expression<'a>>span: Span<'a>
Binary

Fields of Binary

op: BinaryOplhs: Box<Expression<'a>>rhs: Box<Expression<'a>>span: Span<'a>

Methods

impl<'a> Expression<'a>[src]

pub fn span(&self) -> &Span<'a>[src]

fn consume(
    pair: Pair<'a, Rule>,
    climber: &PrecClimber<Rule>
) -> Result<(Self, Span<'a>), ConversionError<Self::FatalError>>
[src]

Trait Implementations

impl<'a> AsRef<Expression<'a>> for Expression<'a>[src]

impl<'a> Debug for Expression<'a>[src]

impl<'a> FromPest<'a> for Expression<'a>[src]

type Rule = Rule

The rule type for the parse tree this type corresponds to.

type FatalError = Error<Rule>

A fatal error during conversion.

impl<'a> PartialEq<Expression<'a>> for Expression<'a>[src]

impl<'a> StructuralPartialEq for Expression<'a>[src]

impl<'a> TryFrom<&'a str> for Expression<'a>[src]

type Error = ConversionError<Error<Rule>>

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Expression<'a>

impl<'a> Send for Expression<'a>

impl<'a> Sync for Expression<'a>

impl<'a> Unpin for Expression<'a>

impl<'a> UnwindSafe for Expression<'a>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.