correct comma printing

This commit is contained in:
Mark Thom
2019-03-31 02:13:58 -06:00
parent 35e91ee47c
commit a2f531eeb7
5 changed files with 49 additions and 38 deletions

View File

@@ -559,17 +559,8 @@ impl ListingCompiler {
get_desc(op_decl.name(), comp_ops)
};
if op_decl.0 == 0 {
// remove all instances of the operator.
if self.module.is_none() {
op_decl.remove(&mut wam_indices.op_dir);
}
Ok(())
} else {
op_decl.submit(self.get_module_name(), existing_desc, &mut indices.op_dir)
}
op_decl.submit(self.get_module_name(), existing_desc, &mut indices.op_dir)
},
Declaration::UseModule(name) =>
self.use_module(name, code_repo, flags, wam_indices, indices),

View File

@@ -188,7 +188,10 @@ impl MachineState {
where Outputter: HCValueOutputter
{
let mut printer = HCPrinter::from_heap_locs(&self, output, var_dict);
printer.see_all_locs();
printer.quoted = true;
printer.print(addr)
}

View File

@@ -272,7 +272,13 @@ impl Machine {
#[inline]
pub fn add_batched_ops(&mut self, op_dir: OpDir) {
self.indices.op_dir.extend(op_dir.into_iter());
for ((name, fixity), info) in op_dir {
if info.1 == 0 {
self.indices.op_dir.remove(&(name, fixity));
} else {
self.indices.op_dir.insert((name, fixity), info);
}
}
}
#[inline]