The end of a `//` comment starting at `i`: its newline (a `\` before it continues the comment).
(src: &str, mut i: usize)
| 109 | |
| 110 | /// The end of a `//` comment starting at `i`: its newline (a `\` before it continues the comment). |
| 111 | fn line_comment_end(src: &str, mut i: usize) -> usize { |
| 112 | let s = src.as_bytes(); |
| 113 | loop { |
| 114 | let Some(nl) = find(src, i, "\n") else { return s.len() }; |
| 115 | let mut k = nl as isize - 1; |
| 116 | if k >= 0 && s[k as usize] == b'\r' { |
| 117 | k -= 1; |
| 118 | } |
| 119 | if k < 0 || s[k as usize] != b'\\' { |
| 120 | return nl; |
| 121 | } |
| 122 | i = nl + 1; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | /// Past whitespace and comments from `i`. |
| 127 | fn skip_blank(src: &str, mut i: usize) -> usize { |
no test coverage detected