This commit is contained in:
Mark Thom
2019-11-16 19:53:29 -04:00
25 changed files with 448 additions and 4190 deletions

View File

@@ -6,7 +6,6 @@ use crate::prolog::arithmetic::*;
use crate::prolog::clause_types::*;
use crate::prolog::forms::*;
use crate::prolog::heap_iter::*;
use crate::prolog::heap_print::*;
use crate::prolog::instructions::*;
use crate::prolog::machine::INTERRUPT;
use crate::prolog::machine::attributed_variables::*;
@@ -26,7 +25,6 @@ use indexmap::{IndexMap, IndexSet};
use std::cmp::{max, min, Ordering};
use std::f64;
use std::mem;
use std::rc::Rc;
macro_rules! try_numeric_result {
($s: ident, $e: expr, $caller: expr) => {{
@@ -190,39 +188,6 @@ impl MachineState {
}
}
pub(super) fn print_var_eq<Outputter>(
&self,
var: Rc<Var>,
addr: Addr,
op_dir: &OpDir,
mut output: Outputter,
) -> Outputter
where
Outputter: HCValueOutputter,
{
let orig_len = output.len();
output.begin_new_var();
output.append(var.as_str());
output.append(" = ");
let mut printer = HCPrinter::from_heap_locs(&self, op_dir, output);
printer.numbervars = false;
printer.quoted = true;
let mut output = printer.print(addr);
let bad_ending = format!("= {}", &var);
if output.ends_with(&bad_ending) {
output.truncate(orig_len);
}
output
}
pub(super) fn unify_strings(
&mut self,
pdl: &mut Vec<Addr>,