MCPcopy Index your code
hub / github.com/endbasic/endbasic / new

Method new

std/src/program.rs:158–181  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

156impl 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.
171The assembly code printed by this command is provided as a tool to understand how high level code \
172gets translated to the machine code of a fictitious stack-based machine. Note, however, that the \
173assembly 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)]

Callers

nothing calls this directly

Calls 5

with_descriptionMethod · 0.80
with_categoryMethod · 0.80
with_syntaxMethod · 0.80
with_asyncMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected