Return this alternation as an AST. If this alternation contains zero ASTs, then Ast::Empty is returned. If this alternation contains exactly 1 AST, then the corresponding AST is returned. Otherwise, Ast::Alternation is returned.
(mut self)
| 573 | /// returned. If this alternation contains exactly 1 AST, then the |
| 574 | /// corresponding AST is returned. Otherwise, Ast::Alternation is returned. |
| 575 | pub fn into_ast(mut self) -> Ast { |
| 576 | match self.asts.len() { |
| 577 | 0 => Ast::Empty(self.span), |
| 578 | 1 => self.asts.pop().unwrap(), |
| 579 | _ => Ast::Alternation(self), |
| 580 | } |
| 581 | } |
| 582 | } |
| 583 | |
| 584 | /// A concatenation of regular expressions. |
nothing calls this directly
no test coverage detected