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
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
Complete the previous Start
event
Fields of Finish
end: usize
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
range: Range<usize>
Fields of MultipleTokens
amount: u8
kind: SyntaxKind
Implementations
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Event
impl UnwindSafe for Event
Blanket Implementations
Mutably borrows from an owned value. Read more
Whether this implementor has acknowledged the 1.1.0 update to
unerase
’s documented implementation requirements. Read more