revamp evaluable functors, add missing evaluable functors

This commit is contained in:
Mark Thom
2019-05-12 20:14:00 -04:00
parent f988b67403
commit f344150322
19 changed files with 1083 additions and 308 deletions

View File

@@ -4,7 +4,6 @@ use prolog::heap_print::*;
use prolog::machine::*;
use prolog::machine::compile::*;
use prolog::machine::machine_errors::*;
use prolog::num::ToPrimitive;
use std::io::Read;
@@ -47,7 +46,7 @@ impl Machine {
};
let arity = match self.machine_st.store(self.machine_st.deref(arity)) {
Addr::Con(Constant::Number(Number::Integer(arity))) =>
Addr::Con(Constant::Integer(arity)) =>
arity.to_usize().unwrap(),
_ => unreachable!()
};
@@ -192,7 +191,7 @@ impl Machine {
{
let index = self.machine_st[temp_v!(3)].clone();
let index = match self.machine_st.store(self.machine_st.deref(index)) {
Addr::Con(Constant::Number(Number::Integer(n))) => n.to_usize().unwrap(),
Addr::Con(Constant::Integer(n)) => n.to_usize().unwrap(),
_ => unreachable!()
};
@@ -227,7 +226,7 @@ impl Machine {
{
let index = self.machine_st[temp_v!(3)].clone();
let index = match self.machine_st.store(self.machine_st.deref(index)) {
Addr::Con(Constant::Number(Number::Integer(n))) => n.to_usize().unwrap(),
Addr::Con(Constant::Integer(n)) => n.to_usize().unwrap(),
_ => unreachable!()
};