pub fn parse_lines<'a>(arena: &'a Arena<Syntax<'a>>, s: &str) -> Vec<&'a Syntax<'a>> {
    let mut line_start = 0;
    let mut res: Vec<&'a Syntax<'a>> = vec![];

    for (i, c) in s.chars().enumerate() {
        if c == '\n' {
            let line = &s[line_start..i];
            let atom = Syntax::new_atom(
                arena,
                vec![SingleLineSpan {
                    line: res.len().into(),
                    start_col: 0,
                    end_col: i - line_start,
                }],
                line,
                AtomKind::Other,
            );
            res.push(atom);

            line_start = i + 1;
        }
    }

    if let Some(last) = s.chars().last() {
        if last != '\n' {
            let line = &s[line_start..];

            let atom = Syntax::new_atom(
                arena,
                vec![SingleLineSpan {
                    line: res.len().into(),
                    start_col: 0,
                    end_col: s.len() - line_start,
                }],
                line,
                AtomKind::Other,
            );
            res.push(atom);
        }
    }

    res
}
/// Split `s` by lines, and treat each line as an atom.
///
/// This is a fallback for files that we don't know how to parse.
Split `s` by lines, and treat each line as an atom.
This is a fallback for files that we don't know how to parse.
Split ` s ` by lines and treat each line as an atom . This is a fallback for files that we don ' t know how to parse .
pub fn parse_lines<'a>(arena: &'a Arena<Syntax<'a>>, s: &str) -> Vec<&'a Syntax<'a>> {
    let mut line_start = 0;
    let mut res: Vec<&'a Syntax<'a>> = vec![];
    for (i, c) in s.chars().enumerate() {
        if c == '\n' {
            let line = &s[line_start..i];
            let atom = Syntax::new_atom(
                arena,
                vec![SingleLineSpan {
                    line: res.len().into(),
                    start_col: 0,
                    end_col: i - line_start,
                }],
                line,
                AtomKind::Other,
            );
            res.push(atom);
            line_start = i + 1;
        }
    }
    if let Some(last) = s.chars().last() {
        if last != '\n' {
            let line = &s[line_start..];
            let atom = Syntax::new_atom(
                arena,
                vec![SingleLineSpan {
                    line: res.len().into(),
                    start_col: 0,
                    end_col: s.len() - line_start,
                }],
                line,
                AtomKind::Other,
            );
            res.push(atom);
        }
    }
    res
}
pub fn parse_lines < ' a > ( arena : & ' a Arena < Syntax < ' a > > , s : & str ) -> Vec < & ' a Syntax < ' a > > { let mut line_start = 0 ; let mut res : Vec < & ' a Syntax < ' a > > = vec ! [ ] ; for ( i , c ) in s . chars ( ) . enumerate ( ) { if c == '\n' { let line = & s [ line_start .. i ] ; let atom = Syntax :: new_atom ( arena , vec ! [ SingleLineSpan { line res len ( ) into ( ) start_col 0 end_col i line_start } ] , line , AtomKind :: Other , ) ; res . push ( atom ) ; line_start = i + 1 ; } } if let Some ( last ) = s . chars ( ) . last ( ) { if last != '\n' { let line = & s [ line_start .. ] ; let atom = Syntax :: new_atom ( arena , vec ! [ SingleLineSpan { line res len ( ) into ( ) start_col 0 end_col s len ( ) line_start } ] , line , AtomKind :: Other , ) ; res . push ( atom ) ; } } res }
Split `s` by lines, and treat each line as an atom.
Split ` s ` by lines and treat each line as an atom .
arena
&'a Arena<Syntax<'a>>
s
&str