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

Function validate

std/re/src/main/mod.rs:184–195  ·  view source on GitHub ↗

Reject lookbehind whose width is not fixed, which the engine cannot run. */

(node: &Node)

Source from the content-addressed store, hash-verified

182
183/* Reject lookbehind whose width is not fixed, which the engine cannot run. */
184fn validate(node: &Node) -> Result<(), ReError> {
185 match node {
186 Node::Look { node, behind: true, .. } => {
187 if fixed_len(node).is_none() { return Err(ReError::Syntax(String::from("lookbehind requires fixed width"))); }
188 validate(node)
189 }
190 Node::Look { node, .. } => validate(node),
191 Node::Concat(v) | Node::Alt(v) => { for n in v { validate(n)?; } Ok(()) }
192 Node::Group { node, .. } | Node::NonCap(node) | Node::Repeat { node, .. } => validate(node),
193 _ => Ok(()),
194 }
195}

Callers 1

compileMethod · 0.85

Calls 2

fixed_lenFunction · 0.85
is_noneMethod · 0.80

Tested by

no test coverage detected