omit anonymous variables from read_term variable_names and singletons lists

This commit is contained in:
Mark
2023-07-16 22:22:44 -06:00
parent 86c90d77dd
commit a154a34f87
4 changed files with 54 additions and 16 deletions

View File

@@ -71,7 +71,12 @@ impl MockWAM {
printer.var_names = term_write_result
.var_dict
.into_iter()
.map(|(var, cell)| (cell, var))
.map(|(var, cell)| {
match var {
VarKey::VarPtr(var) => (cell, var.clone()),
VarKey::AnonVar(_) => (cell, VarPtr::from(var.to_string()))
}
})
.collect();
Ok(printer.print().result())