aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/lib.rs')
-rw-r--r--crates/ra_parser/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs
index 30ba06aac..3ceeeebd7 100644
--- a/crates/ra_parser/src/lib.rs
+++ b/crates/ra_parser/src/lib.rs
@@ -61,6 +61,14 @@ pub fn parse(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) {
61 event::process(tree_sink, events); 61 event::process(tree_sink, events);
62} 62}
63 63
64/// Parse given tokens into the given sink as a path
65pub fn parse_path(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) {
66 let mut p = parser::Parser::new(token_source);
67 grammar::path(&mut p);
68 let events = p.finish();
69 event::process(tree_sink, events);
70}
71
64/// A parsing function for a specific braced-block. 72/// A parsing function for a specific braced-block.
65pub struct Reparser(fn(&mut parser::Parser)); 73pub struct Reparser(fn(&mut parser::Parser));
66 74