MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / parse_integer_string

Function parse_integer_string

crates/hyperqueue/src/common/parser2.rs:216–230  ·  view source on GitHub ↗

Common parsers

()

Source from the content-addressed store, hash-verified

214
215// Common parsers
216fn parse_integer_string() -> impl CharParser<String> {
217 let digit = chumsky::primitive::filter(|c: &char| c.is_ascii_digit());
218 let underscore = chumsky::primitive::just('_');
219 let digit_or_underscore = underscore.or(digit).repeated();
220
221 digit
222 .chain(digit_or_underscore)
223 .map(|chars| {
224 chars
225 .into_iter()
226 .filter(|c| c.is_ascii_digit())
227 .collect::<String>()
228 })
229 .labelled("number")
230}
231
232/// Parse 4-byte integer.
233pub fn parse_u32() -> impl CharParser<u32> {

Callers 2

parse_u32Function · 0.85
parse_resource_amountFunction · 0.85

Calls 3

orMethod · 0.80
filterMethod · 0.80
into_iterMethod · 0.45

Tested by

no test coverage detected