aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-04-18 13:00:16 +0100
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-04-18 13:00:16 +0100
commit403cd78baee7e9c2410d04ca0304575e7bbab16d (patch)
tree9e7ff9215e3490169c63c12e03c2eb03ca59ba20 /crates/ra_parser/src/lib.rs
parent112fd0ec7d65b5f23865410fd3e188e761d97110 (diff)
parente944fd059de93f305d6a8c40cfac5ebe84548771 (diff)
Merge #1161
1161: Add mbe 'item' matcher r=matklad a=edwin0cheng Add `item` matcher in `ra_mbe` , and added corresponding `item()` parser in `ra_syntax`. This PR also help PR #1148 for `Items` parsing. And hopefully fix #1149 ?! Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/ra_parser/src/lib.rs')
-rw-r--r--crates/ra_parser/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs
index 9133c1b8a..11b5b9a75 100644
--- a/crates/ra_parser/src/lib.rs
+++ b/crates/ra_parser/src/lib.rs
@@ -93,6 +93,11 @@ pub fn parse_stmt(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink,
93 parse_from_tokens(token_source, tree_sink, |p| grammar::stmt(p, with_semi)); 93 parse_from_tokens(token_source, tree_sink, |p| grammar::stmt(p, with_semi));
94} 94}
95 95
96/// Parse given tokens into the given sink as an item
97pub fn parse_item(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) {
98 parse_from_tokens(token_source, tree_sink, grammar::item);
99}
100
96/// A parsing function for a specific braced-block. 101/// A parsing function for a specific braced-block.
97pub struct Reparser(fn(&mut parser::Parser)); 102pub struct Reparser(fn(&mut parser::Parser));
98 103