MCPcopy Create free account
hub / github.com/davidblewett/rure-python / repetition

Method repetition

regex/regex-syntax/src/hir/mod.rs:349–376  ·  view source on GitHub ↗

Creates a repetition HIR expression.

(rep: Repetition)

Source from the content-addressed store, hash-verified

347
348 /// Creates a repetition HIR expression.
349 pub fn repetition(rep: Repetition) -> Hir {
350 let mut info = HirInfo::new();
351 info.set_always_utf8(rep.hir.is_always_utf8());
352 info.set_all_assertions(rep.hir.is_all_assertions());
353 // If this operator can match the empty string, then it can never
354 // be anchored.
355 info.set_anchored_start(
356 !rep.is_match_empty() && rep.hir.is_anchored_start()
357 );
358 info.set_anchored_end(
359 !rep.is_match_empty() && rep.hir.is_anchored_end()
360 );
361 info.set_line_anchored_start(
362 !rep.is_match_empty() && rep.hir.is_anchored_start()
363 );
364 info.set_line_anchored_end(
365 !rep.is_match_empty() && rep.hir.is_anchored_end()
366 );
367 info.set_any_anchored_start(rep.hir.is_any_anchored_start());
368 info.set_any_anchored_end(rep.hir.is_any_anchored_end());
369 info.set_match_empty(rep.is_match_empty() || rep.hir.is_match_empty());
370 info.set_literal(false);
371 info.set_alternation_literal(false);
372 Hir {
373 kind: HirKind::Repetition(rep),
374 info: info,
375 }
376 }
377
378 /// Creates a group HIR expression.
379 pub fn group(group: Group) -> Hir {

Callers

nothing calls this directly

Calls 8

is_always_utf8Method · 0.80
is_all_assertionsMethod · 0.80
is_match_emptyMethod · 0.80
is_anchored_startMethod · 0.80
is_anchored_endMethod · 0.80
is_any_anchored_startMethod · 0.80
is_any_anchored_endMethod · 0.80
RepetitionClass · 0.70

Tested by

no test coverage detected