Like `peek` but stops at the logical-line boundary: a `Newline` yields `None` (unconsumed) so postfix trailers don't bind across statements. `Nl`/`Comment` (bracket-internal) still skip, so multiline `()`/`[]`/`{}` are unaffected. */
(&mut self)
| 370 | |
| 371 | /* Like `peek` but stops at the logical-line boundary: a `Newline` yields `None` (unconsumed) so postfix trailers don't bind across statements. `Nl`/`Comment` (bracket-internal) still skip, so multiline `()`/`[]`/`{}` are unaffected. */ |
| 372 | pub(super) fn peek_same_line(&mut self) -> Option<TokenType> { |
| 373 | loop { |
| 374 | match self.tokens.peek().map(|t| t.kind) { |
| 375 | Some(TokenType::Nl | TokenType::Comment) => { self.tokens.next(); } |
| 376 | Some(TokenType::Newline) | Some(TokenType::Endmarker) | None => return None, |
| 377 | Some(k) => return Some(k), |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | |
| 382 | pub(super) fn patch(&mut self, pos: usize) { |
| 383 | let target = self.chunk.instructions.len() as u16; |
no test coverage detected