MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / concat

Method concat

std/re/src/main/parser.rs:59–72  ·  view source on GitHub ↗

A run of quantified atoms until pipe, close paren, or end. */

(&mut self)

Source from the content-addressed store, hash-verified

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> {

Callers 1

alternationMethod · 0.80

Calls 5

pushMethod · 0.80
quantifiedMethod · 0.80
peekMethod · 0.45
lenMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected