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

Method async_exec

std/src/program.rs:190–216  ·  view source on GitHub ↗
(&self, scope: Scope<'_>)

Source from the content-addressed store, hash-verified

188 }
189
190 async fn async_exec(&self, scope: Scope<'_>) -> CallResult<()> {
191 debug_assert_eq!(0, scope.nargs());
192
193 let image = {
194 let metadata = self.callables_metadata.borrow();
195 let mut callables = HashMap::with_capacity(metadata.len());
196 for (name, metadata) in metadata.iter() {
197 let callable = Rc::from(MetadataCallable { metadata: metadata.clone() });
198 callables.insert(name.clone(), callable as Rc<dyn Callable>);
199 }
200
201 let compiler = Compiler::new(&callables, &[])
202 .map_err(|e| CallError::Syntax(e.pos(), e.message_without_pos()))?;
203 compiler
204 .compile(&mut self.program.borrow().text().as_bytes())
205 .map_err(|e| CallError::Syntax(e.pos(), e.message_without_pos()))?
206 };
207
208 let mut console = self.console.borrow_mut();
209 let mut pager = Pager::new(&mut *console, self.yielder.clone())?;
210 for line in image.disasm() {
211 pager.print(&line).await?;
212 }
213 pager.print("").await?;
214
215 Ok(())
216 }
217}
218
219/// The `EDIT` command.

Callers

nothing calls this directly

Calls 15

continue_if_modifiedFunction · 0.85
iterMethod · 0.80
posMethod · 0.80
message_without_posMethod · 0.80
as_bytesMethod · 0.80
disasmMethod · 0.80
get_stringMethod · 0.80
pushMethod · 0.80
nargsMethod · 0.80
lenMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected