Add mbe stmt matcher

This commit is contained in:
Edwin Cheng 2019-04-17 12:34:43 +08:00
parent 546d9be2a7
commit 57e4122b89
7 changed files with 136 additions and 89 deletions

View file

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