cosmetic changes.

This commit is contained in:
Mark Thom
2016-12-26 14:09:24 -07:00
parent 92ab8406ef
commit 9be3445517
3 changed files with 12 additions and 10 deletions

View File

@@ -139,7 +139,9 @@ pub fn compile_fact<'a>(t: &'a Term) -> Program {
while let Some(t) = queue.pop_front() {
match t {
(r, &Term::Clause(ref atom, ref terms)) => {
fact.push(MachineInstruction::GetStructure(atom.clone(), terms.len(), r));
fact.push(MachineInstruction::GetStructure(atom.clone(),
terms.len(),
r));
let mut counter : usize = reg;

View File

@@ -20,7 +20,7 @@ type Heap = Vec<HeapCell>;
type Registers = Vec<HeapCell>;
pub struct MachineState {
pub struct Machine {
h : usize,
s : usize,
pub fail : bool,
@@ -30,9 +30,9 @@ pub struct MachineState {
registers : Registers
}
impl MachineState {
pub fn new() -> MachineState {
MachineState { h : 0,
impl Machine {
pub fn new() -> Machine {
Machine { h : 0,
s : 0,
fail : false,
heap : Vec::with_capacity(256),
@@ -195,7 +195,7 @@ impl MachineState {
pub fn reset_heap(&mut self) {
let program = self.program.take();
*self = MachineState::new();
*self = Machine::new();
self.program = program;
}