Scan a multi-char token.
(
&mut self,
count: usize,
tok: Token<'a>,
)
| 212 | |
| 213 | // Scan a multi-char token. |
| 214 | fn scan_chars( |
| 215 | &mut self, |
| 216 | count: usize, |
| 217 | tok: Token<'a>, |
| 218 | ) -> Result<LocatedToken<'a>, LocatedError> { |
| 219 | let loc = self.loc(); |
| 220 | for _ in 0..count { |
| 221 | assert_ne!(self.lookahead, None); |
| 222 | self.next_ch(); |
| 223 | } |
| 224 | token(tok, loc) |
| 225 | } |
| 226 | |
| 227 | /// Get the rest of the current line. |
| 228 | /// The next token returned by `next()` will be from the following lines. |