From 9e213385c9d06db3c8ca20812779e2b8f8ad2c71 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 30 Mar 2019 13:25:53 +0300 Subject: switch to new rowan --- crates/ra_parser/src/event.rs | 6 +++--- crates/ra_parser/src/lib.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_parser') diff --git a/crates/ra_parser/src/event.rs b/crates/ra_parser/src/event.rs index c1773e8e0..87cf4eca0 100644 --- a/crates/ra_parser/src/event.rs +++ b/crates/ra_parser/src/event.rs @@ -116,12 +116,12 @@ pub(super) fn process(sink: &mut dyn TreeSink, mut events: Vec) { } for kind in forward_parents.drain(..).rev() { - sink.start_branch(kind); + sink.start_node(kind); } } - Event::Finish => sink.finish_branch(), + Event::Finish => sink.finish_node(), Event::Token { kind, n_raw_tokens } => { - sink.leaf(kind, n_raw_tokens); + sink.token(kind, n_raw_tokens); } Event::Error { msg } => sink.error(msg), } diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs index ddc08e462..30ba06aac 100644 --- a/crates/ra_parser/src/lib.rs +++ b/crates/ra_parser/src/lib.rs @@ -40,15 +40,15 @@ pub trait TokenSource { /// `TreeSink` abstracts details of a particular syntax tree implementation. pub trait TreeSink { - /// Adds new leaf to the current branch. - fn leaf(&mut self, kind: SyntaxKind, n_tokens: u8); + /// Adds new token to the current branch. + fn token(&mut self, kind: SyntaxKind, n_tokens: u8); /// Start new branch and make it current. - fn start_branch(&mut self, kind: SyntaxKind); + fn start_node(&mut self, kind: SyntaxKind); /// Finish current branch and restore previous /// branch as current. - fn finish_branch(&mut self); + fn finish_node(&mut self); fn error(&mut self, error: ParseError); } -- cgit v1.2.3