MCPcopy Index your code
hub / github.com/RustPython/RustPython / search_info_charset

Function search_info_charset

crates/sre_engine/src/engine.rs:1010–1040  ·  view source on GitHub ↗
(
    req: &mut Request<'_, S>,
    state: &mut State,
    mut ctx: MatchContext,
)

Source from the content-addressed store, hash-verified

1008}
1009
1010fn search_info_charset<S: StrDrive>(
1011 req: &mut Request<'_, S>,
1012 state: &mut State,
1013 mut ctx: MatchContext,
1014) -> bool {
1015 let set = &ctx.pattern(req)[5..];
1016
1017 ctx.skip_code_from(req, 1);
1018
1019 req.must_advance = false;
1020
1021 loop {
1022 while !ctx.at_end(req) && !charset(set, ctx.peek_char::<S>()) {
1023 ctx.advance_char::<S>();
1024 }
1025 if ctx.at_end(req) {
1026 return false;
1027 }
1028
1029 req.start = ctx.cursor.position;
1030 state.start = ctx.cursor.position;
1031 state.cursor = ctx.cursor;
1032
1033 if _match(req, state, ctx) {
1034 return true;
1035 }
1036
1037 ctx.advance_char::<S>();
1038 state.marks.clear();
1039 }
1040}
1041
1042#[derive(Debug, Clone, Copy)]
1043struct RepeatContext {

Callers 1

searchMethod · 0.85

Calls 6

charsetFunction · 0.85
_matchFunction · 0.85
skip_code_fromMethod · 0.80
patternMethod · 0.45
at_endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected