MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / print_instr

Function print_instr

crates/cli/src/cmd/dump.rs:54–71  ·  view source on GitHub ↗
(instr: &tinywasm::types::Instruction)

Source from the content-addressed store, hash-verified

52}
53
54fn print_instr(instr: &tinywasm::types::Instruction) -> String {
55 let instr = format!("{instr:?}");
56 let Some(split) = instr.find(['(', ' ', '{']) else {
57 return instr.bold().to_string();
58 };
59
60 let (name, rest) = instr.split_at(split);
61
62 let rest = rest
63 .replace('(', &"(".bright_black().to_string())
64 .replace(')', &")".bright_black().to_string())
65 .replace('{', &"{".bright_black().to_string())
66 .replace('}', &"}".bright_black().to_string())
67 .replace(',', &",".bright_black().to_string())
68 .replace(':', &":".bright_black().to_string());
69
70 format!("{}{}", name.bold(), rest)
71}

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected