Skip to content

Commit 646c8ac

Browse files
committed
impl opinfo charset
1 parent 2366311 commit 646c8ac

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

‎src/engine.rs‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,31 @@ impl<S: StrDrive> State<S> {
367367
}
368368
return;
369369
}
370+
} else if flags.contains(SreInfo::CHARSET) {
371+
let set = &ctx.pattern(req)[5..];
372+
ctx.skip_code_from(req, 1);
373+
req.must_advance = false;
374+
loop {
375+
while !ctx.at_end(req) && !charset(set, ctx.peek_char(req)) {
376+
ctx.skip_char(req, 1);
377+
}
378+
if ctx.at_end(req) {
379+
return;
380+
}
381+
req.start = ctx.string_position;
382+
self.start = ctx.string_position;
383+
self.string_position = ctx.string_position;
384+
385+
self.context_stack.push(ctx);
386+
self._match(req);
387+
388+
if self.has_matched {
389+
return;
390+
}
391+
392+
ctx.skip_char(req, 1);
393+
self.marks.clear();
394+
}
370395
}
371396
}
372397

0 commit comments

Comments
 (0)