diff options
| author | Murarth <murarth@gmail.com> | 2014-11-17 14:37:59 -0700 |
|---|---|---|
| committer | Murarth <murarth@gmail.com> | 2014-11-17 20:26:21 -0700 |
| commit | 2293a04b4936a11fc3e09f3df8a8ab591e034f29 (patch) | |
| tree | bb7b2439ddcc50918c09624e73d1b178601c0a4a /src/libsyntax/util/parser_testing.rs | |
| parent | 7ef200774fbb8e5f4961f63a83cf5bbe27cd5f8f (diff) | |
| download | rust-2293a04b4936a11fc3e09f3df8a8ab591e034f29.tar.gz rust-2293a04b4936a11fc3e09f3df8a8ab591e034f29.zip | |
libsyntax: Add tests for `parse_view_item`
Diffstat (limited to 'src/libsyntax/util/parser_testing.rs')
| -rw-r--r-- | src/libsyntax/util/parser_testing.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index d0faa3c6820..c1ea8f60b82 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -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> { |
