MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / from_mnemonic

Method from_mnemonic

crates/asm-to-binary/src/assembler/token.rs:20–30  ·  view source on GitHub ↗
(m: &str)

Source from the content-addressed store, hash-verified

18
19impl BranchKind {
20 pub fn from_mnemonic(m: &str) -> Option<Self> {
21 match m {
22 "beq" => Some(Self::Beq),
23 "bne" => Some(Self::Bne),
24 "blt" => Some(Self::Blt),
25 "bge" => Some(Self::Bge),
26 "bltu" => Some(Self::Bltu),
27 "bgeu" => Some(Self::Bgeu),
28 _ => None,
29 }
30 }
31}
32
33/// A single logical assembler token, section-aware and fully typed.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected