aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/parsing.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/parsing.rs')
-rw-r--r--crates/ra_syntax/src/parsing.rs24
1 files changed, 24 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..2c92d554e
--- /dev/null
+++ b/crates/ra_syntax/src/parsing.rs
@@ -0,0 +1,24 @@
1#[macro_use]
2mod token_set;
3mod builder;
4mod lexer;
5mod parser_impl;
6mod parser_api;
7mod reparsing;
8mod grammar;
9
10use crate::{
11 parsing::builder::GreenBuilder,
12 syntax_node::{GreenNode, SyntaxError},
13};
14
15pub use self::lexer::{tokenize, Token};
16
17pub(crate) use self::reparsing::incremental_reparse;
18
19pub(crate) fn parse_text(text: &str) -> (GreenNode, Vec<SyntaxError>) {
20 let tokens = tokenize(&text);
21 let (green, errors) =
22 parser_impl::parse_with(GreenBuilder::new(), text, &tokens, grammar::root);
23 (green, errors)
24}