[][src]Enum rslint_parser::Event

pub enum Event {
    Start {
        kind: SyntaxKind,
        start: usize,
        forward_parent: Option<u32>,
    },
    Finish {
        end: usize,
    },
    Token {
        kind: SyntaxKind,
    },
    Error {
        err: ParserError,
    },
}

Events emitted by the Parser, these events are later made into a syntax tree with process into TreeSink.

Variants

Start

This event signifies the start of the node. It should be either abandoned (in which case the kind is TOMBSTONE, and the event is ignored), or completed via a Finish event.

All tokens between a Start and a Finish would become the children of the respective node.

Fields of Start

kind: SyntaxKindstart: usizeforward_parent: Option<u32>
Finish

Complete the previous Start event

Fields of Finish

end: usize
Token

Produce a single leaf-element. n_raw_tokens is used to glue complex contextual tokens. For example, lexer tokenizes >> as >, >, and n_raw_tokens = 2 is used to produced a single >>.

Fields of Token

kind: SyntaxKind
Error

Fields of Error

err: ParserError

Implementations

impl Event[src]

pub fn tombstone(start: usize) -> Self[src]

Trait Implementations

impl Clone for Event[src]

impl Debug for Event[src]

Auto Trait Implementations

impl RefUnwindSafe for Event

impl Send for Event

impl Sync for Event

impl Unpin for Event

impl UnwindSafe for Event

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> Erasable for T

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, 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.