Parse and push a single alternation on to the parser's internal stack. If the top of the stack already has an alternation, then add to that instead of pushing a new one. The concatenation given corresponds to a single alternation branch. The concatenation returned starts the next branch and is empty. This assumes the parser is currently positioned at `|` and will advance the parser to the charac
(&self, mut concat: ast::Concat)
| 654 | /// This assumes the parser is currently positioned at `|` and will advance |
| 655 | /// the parser to the character following `|`. |
| 656 | fn push_alternate(&self, mut concat: ast::Concat) -> Result<ast::Concat> { |
| 657 | assert_eq!(self.char(), '|'); |
| 658 | concat.span.end = self.pos(); |
| 659 | self.push_or_add_alternation(concat); |
| 660 | self.bump(); |
| 661 | Ok(ast::Concat { |
| 662 | span: self.span(), |
| 663 | asts: vec![], |
| 664 | }) |
| 665 | } |
| 666 | |
| 667 | /// Pushes or adds the given branch of an alternation to the parser's |
| 668 | /// internal stack of state. |
no test coverage detected