Scan for a multi-line quoted string with no escape character.
(&mut self)
| 415 | |
| 416 | /// Scan for a multi-line quoted string with no escape character. |
| 417 | fn scan_string(&mut self) -> Result<LocatedToken<'a>, LocatedError> { |
| 418 | let loc = self.loc(); |
| 419 | let begin = self.pos + 1; |
| 420 | |
| 421 | assert_eq!(self.lookahead, Some('"')); |
| 422 | |
| 423 | while let Some(c) = self.next_ch() { |
| 424 | if c == '"' { |
| 425 | break; |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | let end = self.pos; |
| 430 | if self.lookahead != Some('"') { |
| 431 | return error(LexError::InvalidChar, self.loc()); |
| 432 | } |
| 433 | self.next_ch(); |
| 434 | token(Token::String(&self.source[begin..end]), loc) |
| 435 | } |
| 436 | |
| 437 | fn scan_hex_sequence(&mut self) -> Result<LocatedToken<'a>, LocatedError> { |
| 438 | let loc = self.loc(); |