pub fn new_filemap_and_lines(&self, filename: &str, abs_path: Option<&str>,
                                 src: &str) -> Rc<FileMap> {
        let fm = self.new_filemap(filename.to_string(),
                                  abs_path.map(|s| s.to_owned()),
                                  src.to_owned());
        let mut byte_pos: u32 = fm.start_pos.0;
        for line in src.lines() {
            // register the start of this line
            fm.next_line(BytePos(byte_pos));

            // update byte_pos to include this line and the \n at the end
            byte_pos += line.len() as u32 + 1;
        }
        fm
    }
/// Creates a new filemap and sets its line information.
Creates a new filemap and sets its line information.
Creates a new filemap and sets its line information .
pub fn new_filemap_and_lines(&self, filename: &str, abs_path: Option<&str>,
                                 src: &str) -> Rc<FileMap> {
        let fm = self.new_filemap(filename.to_string(),
                                  abs_path.map(|s| s.to_owned()),
                                  src.to_owned());
        let mut byte_pos: u32 = fm.start_pos.0;
        for line in src.lines() {
            // register the start of this line
            fm.next_line(BytePos(byte_pos));
            // update byte_pos to include this line and the \n at the end
            byte_pos += line.len() as u32 + 1;
        }
        fm
    }
pub fn new_filemap_and_lines ( & self , filename : & str , abs_path : Option < & str > , src : & str ) -> Rc < FileMap > { let fm = self . new_filemap ( filename . to_string ( ) , abs_path . map ( | s | s . to_owned ( ) ) , src . to_owned ( ) ) ; let mut byte_pos : u32 = fm . start_pos . 0 ; for line in src . lines ( ) { // register the start of this line fm . next_line ( BytePos ( byte_pos ) ) ; // update byte_pos to include this line and the \n at the end byte_pos += line . len ( ) as u32 + 1 ; } fm }
Creates a new filemap and sets its line information.
Creates a new filemap and sets its line information .
&self
filename
&str
abs_path
Option<&str>
src
&str
&self
filename
&str
abs_path
Option<&str>
src
&str