1
Fork 0
This commit is contained in:
Esteban Küber 2019-02-05 15:20:26 -08:00
commit cba96613de

View file

@ -12,8 +12,11 @@ use std::path::PathBuf;
/// Map a string to tts, using a made-up filename:
pub fn string_to_stream(source_str: String) -> TokenStream {
let ps = ParseSess::new(FilePathMapping::empty());
source_file_to_stream(&ps, ps.source_map()
.new_source_file(PathBuf::from("bogofile").into(), source_str), None)
source_file_to_stream(
&ps,
ps.source_map().new_source_file(PathBuf::from("bogofile").into(),
source_str,
), None).0
}
/// Map string to parser (via tts)