diff options
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r-- | crates/ra_parser/src/grammar.rs | 2 | ||||
-rw-r--r-- | crates/ra_parser/src/lib.rs | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar.rs b/crates/ra_parser/src/grammar.rs index 13c50c79c..67eae749d 100644 --- a/crates/ra_parser/src/grammar.rs +++ b/crates/ra_parser/src/grammar.rs | |||
@@ -167,7 +167,7 @@ impl BlockLike { | |||
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | fn opt_visibility(p: &mut Parser) -> bool { | 170 | pub(crate) fn opt_visibility(p: &mut Parser) -> bool { |
171 | match p.current() { | 171 | match p.current() { |
172 | PUB_KW => { | 172 | PUB_KW => { |
173 | let m = p.start(); | 173 | let m = p.start(); |
diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs index 4787b5b9e..970d699c0 100644 --- a/crates/ra_parser/src/lib.rs +++ b/crates/ra_parser/src/lib.rs | |||
@@ -107,6 +107,13 @@ pub fn parse_item(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) | |||
107 | parse_from_tokens(token_source, tree_sink, grammar::item); | 107 | parse_from_tokens(token_source, tree_sink, grammar::item); |
108 | } | 108 | } |
109 | 109 | ||
110 | /// Parse given tokens into the given sink as an visibility qualifier | ||
111 | pub fn parse_vis(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) { | ||
112 | parse_from_tokens(token_source, tree_sink, |p| { | ||
113 | grammar::opt_visibility(p); | ||
114 | }); | ||
115 | } | ||
116 | |||
110 | pub fn parse_macro_items(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) { | 117 | pub fn parse_macro_items(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) { |
111 | parse_from_tokens(token_source, tree_sink, grammar::macro_items); | 118 | parse_from_tokens(token_source, tree_sink, grammar::macro_items); |
112 | } | 119 | } |