[][src]Enum rune::ParseError

pub enum ParseError {
    UnexpectedEof {
        span: Span,
    },
    ExpectedEof {
        span: Span,
        actual: Kind,
    },
    ExpectedDeclUseImportComponent {
        span: Span,
        actual: Kind,
    },
    ExpectedStringEscape {
        span: Span,
    },
    UnterminatedStrLit {
        span: Span,
    },
    UnterminatedCharLit {
        span: Span,
    },
    UnterminatedByteLit {
        span: Span,
    },
    ExpectedCharClose {
        span: Span,
    },
    ExpectedByteClose {
        span: Span,
    },
    ExpectedTemplateClose {
        span: Span,
    },
    ExpectedCharEscape {
        span: Span,
    },
    TokenMismatch {
        span: Span,
        expected: Kind,
        actual: Kind,
    },
    ExpectedPatError {
        span: Span,
        actual: Kind,
    },
    ExpectedExpr {
        span: Span,
        actual: Kind,
    },
    ExpectedEnumVariant {
        span: Span,
        actual: Kind,
    },
    ExpectedLoop {
        span: Span,
        actual: Kind,
    },
    ExpectedBlockExpr {
        span: Span,
        actual: Kind,
    },
    UnexpectedChar {
        span: Span,
        c: char,
    },
    ExpectedNumber {
        span: Span,
        actual: Kind,
    },
    ExpectedByte {
        span: Span,
        actual: Kind,
    },
    ExpectedChar {
        span: Span,
        actual: Kind,
    },
    ExpectedString {
        span: Span,
        actual: Kind,
    },
    ExpectedOperator {
        span: Span,
        actual: Kind,
    },
    ExpectedBool {
        span: Span,
        actual: Kind,
    },
    ExpectedLitObjectKey {
        span: Span,
        actual: Kind,
    },
    ExpectedUnaryOperator {
        span: Span,
        actual: Kind,
    },
    PrecedenceGroupRequired {
        span: Span,
    },
    BadSlice {
        span: Span,
    },
    BadEscapeSequence {
        span: Span,
    },
    BadNumberLiteral {
        span: Span,
    },
    BadNumberOutOfBounds {
        span: Span,
    },
    BadCharLiteral {
        span: Span,
    },
    BadByteLiteral {
        span: Span,
    },
    UnicodeEscapeNotSupported {
        span: Span,
    },
    BadUnicodeEscape {
        span: Span,
    },
    UnsupportedUnicodeByteEscape {
        span: Span,
    },
    UnsupportedByteEscape {
        span: Span,
    },
    BadByteEscape {
        span: Span,
    },
    InvalidTemplateLiteral {
        span: Span,
    },
    UnexpectedCloseBrace {
        span: Span,
    },
    UnsupportedFieldAccess {
        span: Span,
    },
    ExpectedFunctionArgument {
        span: Span,
    },
    UnsupportedAsyncExpr {
        span: Span,
    },
}

Error when parsing.

Variants

UnexpectedEof

Error raised when we encounter end-of-file but we didn't expect it.

Fields of UnexpectedEof

span: Span

Span that caused the error.

ExpectedEof

Error raised when we expect and end-of-file but it didn't happen.

Fields of ExpectedEof

span: Span

Span that caused the error.

actual: Kind

Kind of the token encountered instead of end-of-file.

ExpectedDeclUseImportComponent

Expected use import but found something else.

Fields of ExpectedDeclUseImportComponent

span: Span

The span of the component.

actual: Kind

The actual token kind.

ExpectedStringEscape

Error encountered when we see a string escape sequence without a character being escaped.

Fields of ExpectedStringEscape

span: Span

Span that caused the error.

UnterminatedStrLit

Expected a string close but didn't see it.

Fields of UnterminatedStrLit

span: Span

Span that caused the error.

UnterminatedCharLit

Encountered an unterminated character literal.

Fields of UnterminatedCharLit

span: Span

The span of the unterminated literal.

UnterminatedByteLit

Encountered an unterminated byte literal.

Fields of UnterminatedByteLit

span: Span

The span of the unterminated literal.

ExpectedCharClose

Expected a character to be closed.

Fields of ExpectedCharClose

span: Span

Span that caused the error.

ExpectedByteClose

Expected a byte to be closed.

Fields of ExpectedByteClose

span: Span

Span that caused the error.

ExpectedTemplateClose

Expected a string template to be closed, but it wasn't.

Fields of ExpectedTemplateClose

span: Span

Span that caused the error.

ExpectedCharEscape

Error encountered when we see a character escape sequence without a character being escaped.

Fields of ExpectedCharEscape

span: Span

Span that caused the error.

TokenMismatch

Encountered an unexpected token.

Fields of TokenMismatch

span: Span

Span that caused the error.

expected: Kind

The kind of the expected token we saw.

actual: Kind

The kind of the actual token we saw.

ExpectedPatError

Expected a pattern but got something else.

Fields of ExpectedPatError

span: Span

Span that caused the error.

actual: Kind

The kind of the actual token we saw.

ExpectedExpr

Expected an expression but got something else.

Fields of ExpectedExpr

span: Span

Span that caused the error.

actual: Kind

The kind of the actual token we saw.

ExpectedEnumVariant

Expected an enum variant but got something else.

Fields of ExpectedEnumVariant

span: Span

Span that caused the error.

actual: Kind

The kind of the actual token we saw.

ExpectedLoop

When we expect to see a loop (typically after a label).

Fields of ExpectedLoop

span: Span

Span that caused the error.

actual: Kind

The kind of the actual token we saw.

ExpectedBlockExpr

Expected a block expression but got something else.

Fields of ExpectedBlockExpr

span: Span

Span that caused the error.

actual: Kind

The kind of the actual token we saw.

UnexpectedChar

Encountered an unexpected character.

Fields of UnexpectedChar

span: Span

Span that caused the error.

c: char

Character encountered.

ExpectedNumber

Expected a number, but got something else.

Fields of ExpectedNumber

span: Span

Span that caused the error.

actual: Kind

The kind of the actual token we saw.

ExpectedByte

Expected a byte, but got something else.

Fields of ExpectedByte

span: Span

Span that caused the error.

actual: Kind

The kind of the actual token we saw.

ExpectedChar

Expected a char, but got something else.

Fields of ExpectedChar

span: Span

Span that caused the error.

actual: Kind

The kind of the actual token we saw.

ExpectedString

Expected a string, but got something else.

Fields of ExpectedString

span: Span

Span that caused the error.

actual: Kind

The actual token kind which was not a string.

ExpectedOperator

Expected an operator but got something else.

Fields of ExpectedOperator

span: Span

The location of the unexpected operator.

actual: Kind

The actual token that was encountered instead of an operator.

ExpectedBool

Expected a boolean literal.

Fields of ExpectedBool

span: Span

The location of the unexpected token.

actual: Kind

The actual token that was encountered.

ExpectedLitObjectKey

Expected a valid object key.

Fields of ExpectedLitObjectKey

span: Span

The location of the unexpected token.

actual: Kind

The actual token that was encountered.

ExpectedUnaryOperator

Expected a unary operator.

Fields of ExpectedUnaryOperator

span: Span

The span that caused the error.

actual: Kind

The actual token.

PrecedenceGroupRequired

Expression group required to break precedence.

Fields of PrecedenceGroupRequired

span: Span

Span that caused the error.

BadSlice

Attempt to read a slice which doesn't exist.

Fields of BadSlice

span: Span

The slice we tried to read.

BadEscapeSequence

Encountered a bad string escape sequence.

Fields of BadEscapeSequence

span: Span

Span of the illegal escape sequence.

BadNumberLiteral

Tried to resolve an illegal number literal.

Fields of BadNumberLiteral

span: Span

Span of the illegal number literal.

BadNumberOutOfBounds

Number out of bounds.

Fields of BadNumberOutOfBounds

span: Span

Span of the illegal number literal.

BadCharLiteral

A bad character literal.

Fields of BadCharLiteral

span: Span

Span containing the bad character literal.

BadByteLiteral

A bad byte literal.

Fields of BadByteLiteral

span: Span

Span containing the bad byte literal.

UnicodeEscapeNotSupported

We tried to parse a unicode escape in a byte sequence.

Fields of UnicodeEscapeNotSupported

span: Span

Where the bad escape is.

BadUnicodeEscape

Error when we encounter a bad unicode escape.

Fields of BadUnicodeEscape

span: Span

Where the bad escape is.

UnsupportedUnicodeByteEscape

Error when we encounter a bad byte escape in bounds.

Fields of UnsupportedUnicodeByteEscape

span: Span

Where the bad escape is.

UnsupportedByteEscape

Error when we encounter a bad byte escape in bounds.

Fields of UnsupportedByteEscape

span: Span

Where the bad escape is.

BadByteEscape

Error when we encounter a bad byte escape.

Fields of BadByteEscape

span: Span

Where the bad escape is.

InvalidTemplateLiteral

When we encounter an invalid template literal.

Fields of InvalidTemplateLiteral

span: Span

The span where the error occured.

UnexpectedCloseBrace

When we encounter an unescaped closing brace }.

Fields of UnexpectedCloseBrace

span: Span

Where the brace was encountered.

UnsupportedFieldAccess

When we encounter an expression that cannot be used in a chained manner.

Fields of UnsupportedFieldAccess

span: Span

Span of the expression that can't be used in a chain.

ExpectedFunctionArgument

Trying to use a token that is not supported as a function argument.

Fields of ExpectedFunctionArgument

span: Span

Where the argument is.

UnsupportedAsyncExpr

Trying to use an expression as async when it's not supported.

Fields of UnsupportedAsyncExpr

span: Span

Where the expression is.

Implementations

impl ParseError[src]

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

Get the span for the parse error.

Trait Implementations

impl Clone for ParseError[src]

impl Copy for ParseError[src]

impl Debug for ParseError[src]

impl Display for ParseError[src]

impl Error for ParseError[src]

impl From<ParseError> for CompileError[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,