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

Method single_match

std/re/src/main/matcher.rs:210–221  ·  view source on GitHub ↗

True when node consumes input[pos] as a single codepoint. */

(&self, node: &Node, pos: usize)

Source from the content-addressed store, hash-verified

208
209 /* True when node consumes input[pos] as a single codepoint. */
210 fn single_match(&self, node: &Node, pos: usize) -> bool {
211 let c = self.input[pos];
212 match node {
213 Node::Char(want) => self.ci_eq(c, *want),
214 Node::AnyChar => self.flags.dotall || c != '\n',
215 Node::Class { items, negated } => {
216 let hit = self.class_hit(items, c);
217 hit != *negated
218 }
219 _ => false,
220 }
221 }
222
223 /* Class membership, widening by case when ignorecase is set. */
224 fn class_hit(&self, items: &[ClassItem], c: char) -> bool {

Callers 2

mMethod · 0.80
repeat_singleMethod · 0.80

Calls 2

ci_eqMethod · 0.80
class_hitMethod · 0.80

Tested by

no test coverage detected