A run of quantified atoms until pipe, close paren, or end. */
(&mut self)
| 57 | |
| 58 | /* A run of quantified atoms until pipe, close paren, or end. */ |
| 59 | fn concat(&mut self) -> Result<Node, ParseError> { |
| 60 | let mut items = Vec::new(); |
| 61 | loop { |
| 62 | match self.peek() { |
| 63 | None | Some('|') | Some(')') => break, |
| 64 | _ => items.push(self.quantified()?), |
| 65 | } |
| 66 | } |
| 67 | match items.len() { |
| 68 | 0 => Ok(Node::Empty), |
| 69 | 1 => Ok(items.pop().unwrap()), |
| 70 | _ => Ok(Node::Concat(items)), |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | /* An atom plus optional repetition operator. */ |
| 75 | fn quantified(&mut self) -> Result<Node, ParseError> { |
no test coverage detected