Skip to content

Commit e681e78

Browse files
committed
added string_to_tts
1 parent 985a92e commit e681e78

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/libsyntax/util/parser_testing.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ pub fn string_to_tts_and_sess (source_str : @str) -> (~[ast::token_tree],@mut Pa
2222
(filemap_to_tts(ps,string_to_filemap(ps,source_str,@"bogofile")),ps)
2323
}
2424

25+
// map a string to tts, using a made-up filename:
26+
pub fn string_to_tts(source_str : @str) -> ~[ast::token_tree] {
27+
let (tts,_) = string_to_tts_and_sess(source_str);
28+
tts
29+
}
30+
2531
pub fn string_to_parser_and_sess(source_str: @str) -> (Parser,@mut ParseSess) {
2632
let ps = new_parse_sess(None);
2733
(new_parser_from_source_str(ps,~[],@"bogofile",source_str),ps)

0 commit comments

Comments
 (0)