libsyntax: Add tests for parse_view_item

This commit is contained in:
Murarth
2014-11-17 14:37:59 -07:00
parent 7ef200774f
commit 2293a04b49
2 changed files with 33 additions and 1 deletions

View File

@@ -67,6 +67,13 @@ pub fn string_to_stmt(source_str : String) -> P<ast::Stmt> {
})
}
/// Parse a string, return a view item
pub fn string_to_view_item (source_str : String) -> ast::ViewItem {
with_error_checking_parse(source_str, |p| {
p.parse_view_item(Vec::new())
})
}
/// Parse a string, return a pat. Uses "irrefutable"... which doesn't
/// (currently) affect parsing.
pub fn string_to_pat(source_str: String) -> P<ast::Pat> {