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

Function parse_grouping

crates/vm/src/format.rs:52–68  ·  view source on GitHub ↗
(grouping: *const libc::c_char)

Source from the content-addressed store, hash-verified

50/// Reads bytes until 0 or CHAR_MAX, then appends 0 (meaning "repeat last group").
51#[cfg(unix)]
52unsafe fn parse_grouping(grouping: *const libc::c_char) -> Vec<u8> {
53 let mut result = Vec::new();
54 if grouping.is_null() {
55 return result;
56 }
57 unsafe {
58 let mut ptr = grouping;
59 while ![0, libc::c_char::MAX].contains(&*ptr) {
60 result.push(*ptr as u8);
61 ptr = ptr.add(1);
62 }
63 }
64 if !result.is_empty() {
65 result.push(0);
66 }
67 result
68}
69
70impl IntoPyException for FormatSpecError {
71 fn into_pyexception(self, vm: &VirtualMachine) -> PyBaseExceptionRef {

Callers 1

get_locale_infoFunction · 0.85

Calls 5

newFunction · 0.85
containsMethod · 0.45
pushMethod · 0.45
addMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected