Creates a new `DISASM` command that dumps the disassembled version of the program.
(
callables_metadata: Rc<RefCell<HashMap<SymbolKey, Rc<CallableMetadata>>>>,
console: Rc<RefCell<dyn Console>>,
program: Rc<RefCell<dyn Program>>,
yielder: Option<Rc<Re
| 156 | impl DisasmCommand { |
| 157 | /// Creates a new `DISASM` command that dumps the disassembled version of the program. |
| 158 | pub fn new( |
| 159 | callables_metadata: Rc<RefCell<HashMap<SymbolKey, Rc<CallableMetadata>>>>, |
| 160 | console: Rc<RefCell<dyn Console>>, |
| 161 | program: Rc<RefCell<dyn Program>>, |
| 162 | yielder: Option<Rc<RefCell<dyn Yielder>>>, |
| 163 | ) -> Rc<Self> { |
| 164 | Rc::from(Self { |
| 165 | metadata: CallableMetadataBuilder::new("DISASM") |
| 166 | .with_async(true) |
| 167 | .with_syntax(&[(&[], None)]) |
| 168 | .with_category(CATEGORY) |
| 169 | .with_description( |
| 170 | "Disassembles the stored program. |
| 171 | The assembly code printed by this command is provided as a tool to understand how high level code \ |
| 172 | gets translated to the machine code of a fictitious stack-based machine. Note, however, that the \ |
| 173 | assembly code cannot be reassembled nor modified at this point.", |
| 174 | ) |
| 175 | .build(), |
| 176 | callables_metadata, |
| 177 | console, |
| 178 | program, |
| 179 | yielder, |
| 180 | }) |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | #[async_trait(?Send)] |
nothing calls this directly
no test coverage detected