aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/parsing.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-02-20 13:50:29 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-02-20 13:50:29 +0000
commit96899f8278b787280bd07d9ac9dce29a610ce40d (patch)
treed02a22f02908fd3c89e50845a06a89b997220fc2 /crates/ra_syntax/src/parsing.rs
parent5b617e3bf8252887a3eb1ce76d4b62cbee74e551 (diff)
parent86a67dce25f11ba9803a5727f77c02fd1f49e2c0 (diff)
Merge #861
861: Move parsing to a separate module r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/parsing.rs')
-rw-r--r--crates/ra_syntax/src/parsing.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/parsing.rs b/crates/ra_syntax/src/parsing.rs
new file mode 100644
index 000000000..761accd7b
--- /dev/null
+++ b/crates/ra_syntax/src/parsing.rs
@@ -0,0 +1,25 @@
1#[macro_use]
2mod token_set;
3mod builder;
4mod lexer;
5mod parser_impl;
6mod parser_api;
7mod grammar;
8mod reparsing;
9
10use crate::{
11 SyntaxError,
12 parsing::builder::GreenBuilder,
13 syntax_node::GreenNode,
14};
15
16pub use self::lexer::{tokenize, Token};
17
18pub(crate) use self::reparsing::incremental_reparse;
19
20pub(crate) fn parse_text(text: &str) -> (GreenNode, Vec<SyntaxError>) {
21 let tokens = tokenize(&text);
22 let (green, errors) =
23 parser_impl::parse_with(GreenBuilder::new(), text, &tokens, grammar::root);
24 (green, errors)
25}