diff options
Diffstat (limited to 'src/libsyntax/util/parser_testing.rs')
| -rw-r--r-- | src/libsyntax/util/parser_testing.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libsyntax/util/parser_testing.rs b/src/libsyntax/util/parser_testing.rs index 76055ca7914..d0961ddbc70 100644 --- a/src/libsyntax/util/parser_testing.rs +++ b/src/libsyntax/util/parser_testing.rs @@ -18,50 +18,50 @@ use parse::token; // map a string to tts, using a made-up filename: return both the token_trees // and the ParseSess -pub fn string_to_tts_and_sess (source_str : @~str) -> (~[ast::token_tree],@mut ParseSess) { +pub fn string_to_tts_and_sess (source_str : @str) -> (~[ast::token_tree],@mut ParseSess) { let ps = new_parse_sess(None); - (filemap_to_tts(ps,string_to_filemap(ps,source_str,~"bogofile")),ps) + (filemap_to_tts(ps,string_to_filemap(ps,source_str,@"bogofile")),ps) } -pub fn string_to_parser_and_sess(source_str: @~str) -> (Parser,@mut ParseSess) { +pub fn string_to_parser_and_sess(source_str: @str) -> (Parser,@mut ParseSess) { let ps = new_parse_sess(None); - (new_parser_from_source_str(ps,~[],~"bogofile",source_str),ps) + (new_parser_from_source_str(ps,~[],@"bogofile",source_str),ps) } // map string to parser (via tts) -pub fn string_to_parser(source_str: @~str) -> Parser { +pub fn string_to_parser(source_str: @str) -> Parser { let (p,_) = string_to_parser_and_sess(source_str); p } -pub fn string_to_crate (source_str : @~str) -> @ast::crate { +pub fn string_to_crate (source_str : @str) -> @ast::crate { string_to_parser(source_str).parse_crate_mod() } // parse a string, return an expr -pub fn string_to_expr (source_str : @~str) -> @ast::expr { +pub fn string_to_expr (source_str : @str) -> @ast::expr { string_to_parser(source_str).parse_expr() } // parse a string, return an item -pub fn string_to_item (source_str : @~str) -> Option<@ast::item> { +pub fn string_to_item (source_str : @str) -> Option<@ast::item> { string_to_parser(source_str).parse_item(~[]) } // parse a string, return an item and the ParseSess -pub fn string_to_item_and_sess (source_str : @~str) -> (Option<@ast::item>,@mut ParseSess) { +pub fn string_to_item_and_sess (source_str : @str) -> (Option<@ast::item>,@mut ParseSess) { let (p,ps) = string_to_parser_and_sess(source_str); (p.parse_item(~[]),ps) } // parse a string, return a stmt -pub fn string_to_stmt(source_str : @~str) -> @ast::stmt { +pub fn string_to_stmt(source_str : @str) -> @ast::stmt { string_to_parser(source_str).parse_stmt(~[]) } // parse a string, return a pat. Uses "irrefutable"... which doesn't // (currently) affect parsing. -pub fn string_to_pat(source_str : @~str) -> @ast::pat { +pub fn string_to_pat(source_str : @str) -> @ast::pat { string_to_parser(source_str).parse_pat() } |
