pub fn new(source: &'a str) -> Self {
        let mut lines = Vec::new();
        lines.push(0);
        let ci = source.char_indices();
        for (i, c) in ci {
            match c {
                '\n' => lines.push((i + 1) as u32),
                _ => (),
            }
        }
        Self { source, lines }
    }
/// Create a new Locator for the given source code
Create a new Locator for the given source code
Create a new Locator for the given source code
pub fn new(source: &'a str) -> Self {
        let mut lines = Vec::new();
        lines.push(0);
        let ci = source.char_indices();
        for (i, c) in ci {
            match c {
                '\n' => lines.push((i + 1) as u32),
                _ => (),
            }
        }
        Self { source, lines }
    }
pub fn new ( source : & ' a str ) -> Self { let mut lines = Vec :: new ( ) ; lines . push ( 0 ) ; let ci = source . char_indices ( ) ; for ( i , c ) in ci { match c { '\n' => lines . push ( ( i + 1 ) as u32 ) , _ => ( ) , } } Self { source , lines } }
Create a new Locator for the given source code
Create a new Locator for the given source code
source
&'a str
source
&'a str