| 241 | type Item = TokenizedLine; |
| 242 | |
| 243 | fn next(&mut self) -> Option<Self::Item> { |
| 244 | if self.position >= self.content.len() { |
| 245 | return None; |
| 246 | } |
| 247 | |
| 248 | // Find the end of this line |
| 249 | let start = self.position; |
| 250 | let mut end = start; |
| 251 | |
| 252 | while end < self.content.len() && self.content[end] != b'\n' { |
| 253 | end += 1; |
| 254 | } |
| 255 | |
| 256 | // Extract line content (without newline) |
| 257 | let line_content = &self.content[start..end]; |
| 258 | |
| 259 | // Move past the newline |
| 260 | self.position = if end < self.content.len() { |
| 261 | end + 1 |
| 262 | } else { |
| 263 | end |
| 264 | }; |
| 265 | |
| 266 | let line_number = self.line_number; |
| 267 | self.line_number += 1; |
| 268 | |
| 269 | Some(ContentTokenizer::tokenize_line_internal( |
| 270 | line_content, |
| 271 | line_number, |
| 272 | &self.options, |
| 273 | )) |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | impl<'a> LineIterator<'a> { |