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

Method read_hex

std/re/src/main/parser.rs:328–336  ·  view source on GitHub ↗
(&mut self, n: usize)

Source from the content-addressed store, hash-verified

326 }
327
328 fn read_hex(&mut self, n: usize) -> Result<char, ParseError> {
329 let mut acc: u32 = 0;
330 for _ in 0..n {
331 let d = self.peek().and_then(|c| c.to_digit(16)).ok_or(self.err("bad hex escape"))?;
332 acc = acc * 16 + d;
333 self.bump();
334 }
335 char::from_u32(acc).ok_or(self.err("invalid codepoint"))
336 }
337}
338
339fn single(item: ClassItem) -> Vec<ClassItem> {

Callers 2

class_escapeMethod · 0.80
escapeMethod · 0.80

Calls 3

bumpMethod · 0.80
peekMethod · 0.45
errMethod · 0.45

Tested by

no test coverage detected