diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-20 20:33:40 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-20 20:33:40 +0000 |
commit | c84561bb624280b84eb2fe6c6b2a6b9fe3f1dbf7 (patch) | |
tree | e47aa900bcffffded370b68b2e50604199b491e3 /crates/ra_syntax/src/parsing/reparsing.rs | |
parent | 96899f8278b787280bd07d9ac9dce29a610ce40d (diff) | |
parent | 882c47f1870f15cb2aaad8871ccbad1c51520f49 (diff) |
Merge #863
863: Token source r=matklad a=matklad
Some reshuffling of parser's API with the eye towards extracting parse **without** syntax tree into a separate crate, to be used with macro expansion
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, 3 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs index edf3fa291..f2d218ab9 100644 --- a/crates/ra_syntax/src/parsing/reparsing.rs +++ b/crates/ra_syntax/src/parsing/reparsing.rs | |||
@@ -4,10 +4,9 @@ use crate::{ | |||
4 | syntax_node::{GreenNode, SyntaxNode}, | 4 | syntax_node::{GreenNode, SyntaxNode}, |
5 | syntax_error::SyntaxError, | 5 | syntax_error::SyntaxError, |
6 | parsing::{ | 6 | parsing::{ |
7 | grammar, | 7 | grammar, parse_with, |
8 | parser_impl, | ||
9 | builder::GreenBuilder, | 8 | builder::GreenBuilder, |
10 | parser_api::Parser, | 9 | parser::Parser, |
11 | lexer::{tokenize, Token}, | 10 | lexer::{tokenize, Token}, |
12 | } | 11 | } |
13 | }; | 12 | }; |
@@ -62,8 +61,7 @@ fn reparse_block<'node>( | |||
62 | if !is_balanced(&tokens) { | 61 | if !is_balanced(&tokens) { |
63 | return None; | 62 | return None; |
64 | } | 63 | } |
65 | let (green, new_errors) = | 64 | let (green, new_errors) = parse_with(GreenBuilder::default(), &text, &tokens, reparser); |
66 | parser_impl::parse_with(GreenBuilder::new(), &text, &tokens, reparser); | ||
67 | Some((node, green, new_errors)) | 65 | Some((node, green, new_errors)) |
68 | } | 66 | } |
69 | 67 | ||