TreeSink

Trait TreeSink 

Source
pub trait TreeSink {
    type Kind: SyntaxKind;

    // Required methods
    fn token(&mut self, kind: Self::Kind, end: TextSize);
    fn start_node(&mut self, kind: Self::Kind);
    fn finish_node(&mut self);
    fn errors(&mut self, errors: Vec<ParseDiagnostic>);
}
Expand description

An abstraction for syntax tree implementations

Required Associated Types§

Required Methods§

Source

fn token(&mut self, kind: Self::Kind, end: TextSize)

Adds new token to the current branch.

Source

fn start_node(&mut self, kind: Self::Kind)

Start new branch and make it current.

Source

fn finish_node(&mut self)

Finish current branch and restore previous branch as current.

Source

fn errors(&mut self, errors: Vec<ParseDiagnostic>)

Emit errors

Implementors§

Source§

impl<'a, L, Factory> TreeSink for LosslessTreeSink<'a, L, Factory>
where L: Language, Factory: SyntaxFactory<Kind = L::Kind>,

Source§

type Kind = <L as Language>::Kind