MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / custom_error

Function custom_error

src/debug_utils/generic_function/parse.rs:38–45  ·  view source on GitHub ↗

Helper function to emit a custom error at the given span.

(span: Span<'_>, msg: &str)

Source from the content-addressed store, hash-verified

36
37/// Helper function to emit a custom error at the given span.
38fn custom_error(span: Span<'_>, msg: &str) -> Error<Rule> {
39 Error::new_from_span(
40 ErrorVariant::<Rule>::CustomError {
41 message: msg.into(),
42 },
43 span,
44 )
45}
46
47fn parse_number<T: FromStr>(pair: Pair<'_, Rule>) -> Result<T> {
48 Ok(pair.as_str().parse().map_err(|_| {

Callers 6

parse_numberFunction · 0.70
parse_expected_entityFunction · 0.70
parse_value_declarationFunction · 0.70
parse_block_labelFunction · 0.70
parse_attributeFunction · 0.70
parse_instructionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected