added string_to_tts
This commit is contained in:
@@ -22,6 +22,12 @@ pub fn string_to_tts_and_sess (source_str : @str) -> (~[ast::token_tree],@mut Pa
|
|||||||
(filemap_to_tts(ps,string_to_filemap(ps,source_str,@"bogofile")),ps)
|
(filemap_to_tts(ps,string_to_filemap(ps,source_str,@"bogofile")),ps)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// map a string to tts, using a made-up filename:
|
||||||
|
pub fn string_to_tts(source_str : @str) -> ~[ast::token_tree] {
|
||||||
|
let (tts,_) = string_to_tts_and_sess(source_str);
|
||||||
|
tts
|
||||||
|
}
|
||||||
|
|
||||||
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);
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user