mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
docing parser methods
This commit is contained in:
parent
582ea0a29a
commit
ea7b569e1b
4 changed files with 23 additions and 12 deletions
|
@ -22,10 +22,21 @@ use crate::SyntaxKind::{self, EOF, TOMBSTONE};
|
|||
pub(crate) trait Sink {
|
||||
type Tree;
|
||||
|
||||
/// Adds new leaf to the current branch.
|
||||
fn leaf(&mut self, kind: SyntaxKind, text: SmolStr);
|
||||
fn start_internal(&mut self, kind: SyntaxKind);
|
||||
fn finish_internal(&mut self);
|
||||
|
||||
/// Start new branch and make it current.
|
||||
fn start_branch(&mut self, kind: SyntaxKind);
|
||||
|
||||
/// Finish current branch and restore previous
|
||||
/// branch as current.
|
||||
fn finish_branch(&mut self);
|
||||
|
||||
fn error(&mut self, error: SyntaxError);
|
||||
|
||||
/// Complete tree building. Make sure that
|
||||
/// `start_branch` and `finish_branch` calls
|
||||
/// are paired!
|
||||
fn finish(self) -> Self::Tree;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue