cosmetic changes.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user