Parse `rd, symbol` for the `la` pseudo-instruction.
(operands: &str)
| 532 | Some((rs1, imm)) |
| 533 | } |
| 534 | |
| 535 | fn split_mnemonic(line: &str) -> (&str, &str) { |
| 536 | match line.find(|c: char| c.is_whitespace()) { |
| 537 | Some(idx) => (&line[..idx], line[idx..].trim_start()), |
| 538 | None => (line, ""), |
| 539 | } |
| 540 | } |
| 541 | |
| 542 | // Parse `rs1, rs2, label` for a branch instruction. |
| 543 | fn parse_branch(kind: BranchKind, operands: &str) -> Option<AsmToken> { |
| 544 | let parts: Vec<&str> = operands.splitn(3, ',').collect(); |
| 545 | if parts.len() != 3 { |
| 546 | return None; |
| 547 | } |
| 548 | let rs1 = parse_int_reg(parts[0].trim())?; |
| 549 | let rs2 = parse_int_reg(parts[1].trim())?; |
nothing calls this directly
no test coverage detected