[][src]Struct libslide::parser::errors::IllegalVariable

pub(crate) struct IllegalVariable;

Variables are illegal in a slide expression pattern.

In most cases, this error is fired because you intended to evaluate an expression with slide, or wrote a variable in place of a variable pattern.

Because expression patterns are meant to abstract over and match expressions, there is generally not a need to explicitly define the name of a variable to be matched by an expression pattern. Rather, the concern is generally with the shape of the variable; that is, that it is actually a variable. For this use case, the "${name}" pattern (where "{name}" is a text placeholder) serves as a variable-matching pattern.

As a concrete example, the expression pattern $a + $b + $a matches both the expressions a + b + a and b + a + b. Both expressions are lowered the same way despite having different variable names, so variable patterns permit abstraction and common representation over the names.

Trait Implementations

impl DiagnosticRecord for IllegalVariable[src]

Auto Trait Implementations

impl RefUnwindSafe for IllegalVariable

impl Send for IllegalVariable

impl Sync for IllegalVariable

impl Unpin for IllegalVariable

impl UnwindSafe for IllegalVariable

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.