| 52 | } |
| 53 | |
| 54 | fn 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 | } |