3 // pretty-expanded FIXME #23616
4 // ignore-cloudabi no std::fs
7 use std::io::{self, BufReader, Read};
14 impl<R: Read> Lexer<R>
16 pub fn new_from_reader(r: R) -> Lexer<R>
18 Lexer{reader: BufReader::new(r)}
21 pub fn new_from_file(p: &str) -> io::Result<Lexer<File>>
23 Ok(Lexer::new_from_reader(File::open(p)?))
26 pub fn new_from_str<'a>(s: &'a str) -> Lexer<&'a [u8]>
28 Lexer::new_from_reader(s.as_bytes())