pull/8675/merge^2
mattwparas 2023-08-22 17:05:00 -07:00
parent 20d7d6a426
commit a73e212a7c
1 changed files with 18 additions and 5 deletions

View File

@ -1263,7 +1263,7 @@ fn configure_engine() -> std::rc::Rc<std::cell::RefCell<steel::steel_vm::engine:
// mangler/home/matt/Documents/steel/cogs/logging/log.scmlog/warn!__doc__ // mangler/home/matt/Documents/steel/cogs/logging/log.scmlog/warn!__doc__
let module_prefix = "mangler".to_string() + helix_module_path.as_os_str().to_str().unwrap(); // let module_prefix = "mangler".to_string() + helix_module_path.as_os_str().to_str().unwrap();
let module = engine.extract_value(&helix_path).unwrap(); let module = engine.extract_value(&helix_path).unwrap();
@ -1283,13 +1283,26 @@ fn configure_engine() -> std::rc::Rc<std::cell::RefCell<steel::steel_vm::engine:
let docs = exported let docs = exported
.iter() .iter()
.filter_map(|x| { .filter_map(|x| {
if let Ok(steel::rvals::SteelVal::StringV(d)) = if let Ok(value) = engine.run(&format!(
engine.extract_value(&(module_prefix.to_string() + x.as_str() + "__doc__")) "(#%function-ptr-table-get #%function-ptr-table {})",
{ x
Some((x.to_string(), d.to_string())) )) {
if let Some(SteelVal::StringV(doc)) = value.first() {
Some((x.to_string(), doc.to_string()))
} else {
None
}
} else { } else {
None None
} }
// if let Ok(steel::rvals::SteelVal::StringV(d)) =
// engine.extract_value(&(module_prefix.to_string() + x.as_str() + "__doc__"))
// {
// Some((x.to_string(), d.to_string()))
// } else {
// None
// }
}) })
.collect::<HashMap<_, _>>(); .collect::<HashMap<_, _>>();