(pair: Pair<'_, Rule>)
| 305 | } |
| 306 | |
| 307 | fn parse_constraint(pair: Pair<'_, Rule>) -> Result<OperandConstraint> { |
| 308 | let constraint_pair = pair.into_inner().next().unwrap(); |
| 309 | let constraint = match constraint_pair.as_rule() { |
| 310 | Rule::physreg => OperandConstraint::Fixed(parse_entity(constraint_pair)?), |
| 311 | Rule::regclass => OperandConstraint::Class(parse_entity(constraint_pair)?), |
| 312 | Rule::reuse => { |
| 313 | let [number] = extract(constraint_pair, [Rule::number]); |
| 314 | OperandConstraint::Reuse(parse_number(number)?) |
| 315 | } |
| 316 | _ => unreachable!(), |
| 317 | }; |
| 318 | Ok(constraint) |
| 319 | } |
| 320 | |
| 321 | fn parse_instruction( |
| 322 | pair: Pair<'_, Rule>, |
no test coverage detected