If the `x` flag is enabled (i.e., whitespace insensitivity with comments), then this will advance the parser through all whitespace and comments to the next non-whitespace non-comment byte. If the `x` flag is disabled, then this is a no-op. This should be used selectively throughout the parser where arbitrary whitespace is permitted when the `x` flag is enabled. For example, `{ 5 , 6}` is equ
(&self)
| 548 | /// arbitrary whitespace is permitted when the `x` flag is enabled. For |
| 549 | /// example, `{ 5 , 6}` is equivalent to `{5,6}`. |
| 550 | fn bump_space(&self) { |
| 551 | if !self.ignore_whitespace() { |
| 552 | return; |
| 553 | } |
| 554 | while !self.is_eof() { |
| 555 | if self.char().is_whitespace() { |
| 556 | self.bump(); |
| 557 | } else if self.char() == '#' { |
| 558 | let start = self.pos(); |
| 559 | let mut comment_text = String::new(); |
| 560 | self.bump(); |
| 561 | while !self.is_eof() { |
| 562 | let c = self.char(); |
| 563 | self.bump(); |
| 564 | if c == '\n' { |
| 565 | break; |
| 566 | } |
| 567 | comment_text.push(c); |
| 568 | } |
| 569 | let comment = ast::Comment { |
| 570 | span: Span::new(start, self.pos()), |
| 571 | comment: comment_text, |
| 572 | }; |
| 573 | self.parser().comments.borrow_mut().push(comment); |
| 574 | } else { |
| 575 | break; |
| 576 | } |
| 577 | } |
| 578 | } |
| 579 | |
| 580 | /// Peek at the next character in the input without advancing the parser. |
| 581 | /// |
no test coverage detected