Add item matcher in mbe

This commit is contained in:
Edwin Cheng 2019-04-18 10:21:36 +08:00
parent 112fd0ec7d
commit e944fd059d
6 changed files with 70 additions and 0 deletions

View file

@ -93,6 +93,11 @@ pub fn parse_stmt(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink,
parse_from_tokens(token_source, tree_sink, |p| grammar::stmt(p, with_semi));
}
/// Parse given tokens into the given sink as an item
pub fn parse_item(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) {
parse_from_tokens(token_source, tree_sink, grammar::item);
}
/// A parsing function for a specific braced-block.
pub struct Reparser(fn(&mut parser::Parser));