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

Function parse_expected_entity

src/debug_utils/generic_function/parse.rs:61–71  ·  view source on GitHub ↗
(pair: Pair<'_, Rule>, expected: T)

Source from the content-addressed store, hash-verified

59}
60
61fn parse_expected_entity<T: EntityRef>(pair: Pair<'_, Rule>, expected: T) -> Result<()> {
62 let span = pair.as_span();
63 let entity = parse_entity::<T>(pair)?;
64 if entity != expected {
65 Err(custom_error(
66 span,
67 "must be declared in order and with no gaps",
68 ))?;
69 }
70 Ok(())
71}
72
73fn parse_entity_list<T: EntityRef>(pair: Pair<'_, Rule>) -> Result<Vec<T>> {
74 let mut out = vec![];

Callers 2

parse_value_declarationFunction · 0.70
parse_block_labelFunction · 0.70

Calls 1

custom_errorFunction · 0.70

Tested by

no test coverage detected