pub fn location(&self, source: &str) -> SourceLocation {
        let prefix = &source[..self.start as usize];
        let line_number = prefix.matches('\n').count() as u32 + 1;
        let line_start = prefix.rfind('\n').map(|pos| pos + 1).unwrap_or(0);
        let line_position = source[line_start..self.start as usize].chars().count() as u32 + 1;

        SourceLocation {
            line_number,
            line_position,
            offset: self.start,
            length: self.end - self.start,
        }
    }
/// Return a [`SourceLocation`] for this span in the provided source.
Return a [`SourceLocation`] for this span in the provided source.
Return a [ ` SourceLocation ` ] for this span in the provided source .
pub fn location(&self, source: &str) -> SourceLocation {
        let prefix = &source[..self.start as usize];
        let line_number = prefix.matches('\n').count() as u32 + 1;
        let line_start = prefix.rfind('\n').map(|pos| pos + 1).unwrap_or(0);
        let line_position = source[line_start..self.start as usize].chars().count() as u32 + 1;
        SourceLocation {
            line_number,
            line_position,
            offset: self.start,
            length: self.end - self.start,
        }
    }
pub fn location ( & self , source : & str ) -> SourceLocation { let prefix = & source [ .. self . start as usize ] ; let line_number = prefix . matches ( '\n' ) . count ( ) as u32 + 1 ; let line_start = prefix . rfind ( '\n' ) . map ( | pos | pos + 1 ) . unwrap_or ( 0 ) ; let line_position = source [ line_start .. self . start as usize ] . chars ( ) . count ( ) as u32 + 1 ; SourceLocation { line_number , line_position , offset : self . start , length : self . end - self . start , } }
Return a [`SourceLocation`] for this span in the provided source.
Return a [ ` SourceLocation ` ] for this span in the provided source .
&self
source
&str
&self
source
&str