diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-24 10:15:43 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-24 10:15:43 +0000 |
commit | f6f160391db945a0dcc2f73b38926d6919f7c566 (patch) | |
tree | 060450b70c09357615f261d8acd032a647615dd7 /crates/ra_syntax/src/parsing/reparsing.rs | |
parent | c5e74cebdcbade069c0e1e81e298ab7d729e4cd5 (diff) | |
parent | 81bca78349afb9e15994f46401da0cfabfba04a1 (diff) |
Merge #885
885: Parse token trees directy r=matklad a=matklad
This takes advantage of the recent macro refactoring to directly parse token stream into a syntax tree.
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/parsing/reparsing.rs')
-rw-r--r-- | crates/ra_syntax/src/parsing/reparsing.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs index 19d8adcfb..ba77a3b6c 100644 --- a/crates/ra_syntax/src/parsing/reparsing.rs +++ b/crates/ra_syntax/src/parsing/reparsing.rs | |||
@@ -14,8 +14,8 @@ use crate::{ | |||
14 | algo, | 14 | algo, |
15 | syntax_node::{GreenNode, SyntaxNode}, | 15 | syntax_node::{GreenNode, SyntaxNode}, |
16 | parsing::{ | 16 | parsing::{ |
17 | input::ParserInput, | 17 | text_token_source::TextTokenSource, |
18 | builder::TreeBuilder, | 18 | text_tree_sink::TextTreeSink, |
19 | lexer::{tokenize, Token}, | 19 | lexer::{tokenize, Token}, |
20 | } | 20 | } |
21 | }; | 21 | }; |
@@ -68,8 +68,8 @@ fn reparse_block<'node>( | |||
68 | if !is_balanced(&tokens) { | 68 | if !is_balanced(&tokens) { |
69 | return None; | 69 | return None; |
70 | } | 70 | } |
71 | let token_source = ParserInput::new(&text, &tokens); | 71 | let token_source = TextTokenSource::new(&text, &tokens); |
72 | let mut tree_sink = TreeBuilder::new(&text, &tokens); | 72 | let mut tree_sink = TextTreeSink::new(&text, &tokens); |
73 | reparser.parse(&token_source, &mut tree_sink); | 73 | reparser.parse(&token_source, &mut tree_sink); |
74 | let (green, new_errors) = tree_sink.finish(); | 74 | let (green, new_errors) = tree_sink.finish(); |
75 | Some((node, green, new_errors)) | 75 | Some((node, green, new_errors)) |