| 397 | } |
| 398 | |
| 399 | fn scan_name(&mut self) -> Result<LocatedToken<'a>, LocatedError> { |
| 400 | let loc = self.loc(); |
| 401 | let begin = self.pos + 1; |
| 402 | |
| 403 | assert_eq!(self.lookahead, Some('%')); |
| 404 | |
| 405 | loop { |
| 406 | match self.next_ch() { |
| 407 | Some('_') | Some('0'..='9') | Some('a'..='z') | Some('A'..='Z') => {} |
| 408 | _ => break, |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | let end = self.pos; |
| 413 | token(Token::Name(&self.source[begin..end]), loc) |
| 414 | } |
| 415 | |
| 416 | /// Scan for a multi-line quoted string with no escape character. |
| 417 | fn scan_string(&mut self) -> Result<LocatedToken<'a>, LocatedError> { |