From 3517c175ac537b47dd3e36cc7fb1edd60b02c039 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 20 Feb 2019 21:08:59 +0300 Subject: rename Sink -> TreeSink --- crates/ra_syntax/src/parsing/builder.rs | 4 ++-- crates/ra_syntax/src/parsing/parser_impl.rs | 4 ++-- crates/ra_syntax/src/parsing/parser_impl/event.rs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'crates') diff --git a/crates/ra_syntax/src/parsing/builder.rs b/crates/ra_syntax/src/parsing/builder.rs index 9090c60c2..118f43b2c 100644 --- a/crates/ra_syntax/src/parsing/builder.rs +++ b/crates/ra_syntax/src/parsing/builder.rs @@ -1,5 +1,5 @@ use crate::{ - parsing::parser_impl::Sink, + parsing::parser_impl::TreeSink, syntax_node::{GreenNode, RaTypes}, SmolStr, SyntaxKind, SyntaxError, }; @@ -17,7 +17,7 @@ impl GreenBuilder { } } -impl Sink for GreenBuilder { +impl TreeSink for GreenBuilder { type Tree = (GreenNode, Vec); fn leaf(&mut self, kind: SyntaxKind, text: SmolStr) { diff --git a/crates/ra_syntax/src/parsing/parser_impl.rs b/crates/ra_syntax/src/parsing/parser_impl.rs index 8cce1ab01..02baed76b 100644 --- a/crates/ra_syntax/src/parsing/parser_impl.rs +++ b/crates/ra_syntax/src/parsing/parser_impl.rs @@ -18,7 +18,7 @@ use crate::{ use crate::SyntaxKind::{self, EOF, TOMBSTONE}; -pub(super) trait Sink { +pub(super) trait TreeSink { type Tree; /// Adds new leaf to the current branch. @@ -40,7 +40,7 @@ pub(super) trait Sink { } /// Parse a sequence of tokens into the representative node tree -pub(super) fn parse_with( +pub(super) fn parse_with( sink: S, text: &str, tokens: &[Token], diff --git a/crates/ra_syntax/src/parsing/parser_impl/event.rs b/crates/ra_syntax/src/parsing/parser_impl/event.rs index 2ddbdd34d..9663fba35 100644 --- a/crates/ra_syntax/src/parsing/parser_impl/event.rs +++ b/crates/ra_syntax/src/parsing/parser_impl/event.rs @@ -3,7 +3,7 @@ //! parser, so as to allow to evolve the tree representation //! and the parser algorithm independently. //! -//! The `Sink` trait is the bridge between the parser and the +//! The `TreeSink` trait is the bridge between the parser and the //! tree builder: the parser produces a stream of events like //! `start node`, `finish node`, and `FileBuilder` converts //! this stream to a real tree. @@ -20,7 +20,7 @@ use crate::{ }, parsing::{ lexer::Token, - parser_impl::Sink, + parser_impl::TreeSink, }, }; @@ -93,7 +93,7 @@ impl Event { } } -pub(super) struct EventProcessor<'a, S: Sink> { +pub(super) struct EventProcessor<'a, S: TreeSink> { sink: S, text_pos: TextUnit, text: &'a str, @@ -102,7 +102,7 @@ pub(super) struct EventProcessor<'a, S: Sink> { events: &'a mut [Event], } -impl<'a, S: Sink> EventProcessor<'a, S> { +impl<'a, S: TreeSink> EventProcessor<'a, S> { pub(super) fn new( sink: S, text: &'a str, -- cgit v1.2.3