Enum rslint_parser::Event[][src]

pub enum Event {
    Start {
        kind: SyntaxKind,
        start: usize,
        forward_parent: Option<u32>,
    },
    Finish {
        end: usize,
    },
    Token {
        kind: SyntaxKind,
        range: Range<usize>,
    },
    MultipleTokens {
        amount: u8,
        kind: SyntaxKind,
    },
}
Expand description

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: SyntaxKindrange: Range<usize>
MultipleTokens

Fields of MultipleTokens

amount: u8kind: SyntaxKind

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Unerase this erased pointer. Read more

Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more

Turn this erasable pointer into an erased pointer. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.