Past whitespace and comments from `i`.
(src: &str, mut i: usize)
| 125 | |
| 126 | /// Past whitespace and comments from `i`. |
| 127 | fn skip_blank(src: &str, mut i: usize) -> usize { |
| 128 | let s = src.as_bytes(); |
| 129 | while i < s.len() { |
| 130 | let c = s[i]; |
| 131 | if is_blank(c) || c == b'\n' { |
| 132 | i += 1; |
| 133 | } else if c == b'/' && at(s, i + 1) == b'/' { |
| 134 | i = line_comment_end(src, i + 2); |
| 135 | } else if c == b'/' && at(s, i + 1) == b'*' { |
| 136 | i = find(src, i + 2, "*/").map_or(s.len(), |e| e + 2); |
| 137 | } else { |
| 138 | break; |
| 139 | } |
| 140 | } |
| 141 | i |
| 142 | } |
| 143 | |
| 144 | /// The end of the identifier at `i`, if one starts there. |
| 145 | fn word_end(s: &[u8], i: usize) -> Option<usize> { |
no test coverage detected