From 91b9aed33a45e84eafc2af4bdb17ca42926d221f Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Wed, 10 May 2017 10:21:02 -0600 Subject: [PATCH] code cleanup --- src/prolog/codegen.rs | 2 +- src/prolog/machine.rs | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/prolog/codegen.rs b/src/prolog/codegen.rs index 193e145e..00d07d4b 100644 --- a/src/prolog/codegen.rs +++ b/src/prolog/codegen.rs @@ -258,7 +258,7 @@ impl<'a, TermMarker: Allocator<'a>> CodeGenerator<'a, TermMarker> { match toc { &TermOrCut::Term(Term::Clause(_, ref name, _)) - | &TermOrCut::Term(Term::Constant(_, Constant::Atom(ref name))) => { + | &TermOrCut::Term(Term::Constant(_, Constant::Atom(ref name))) => { if let &mut Line::Control(ref mut ctrl) = body.last_mut().unwrap() { *ctrl = ControlInstruction::Execute(name.clone(), last_arity); } diff --git a/src/prolog/machine.rs b/src/prolog/machine.rs index 63e68c83..6efb3e12 100644 --- a/src/prolog/machine.rs +++ b/src/prolog/machine.rs @@ -310,7 +310,7 @@ impl Machine { self.ms.p = self.ms.or_stack[b].bp; if let CodePtr::TopLevel(_, 0) = self.ms.p { - return EvalSession::QueryFailure + return EvalSession::QueryFailure; } self.run_query(alloc_locs, heap_locs); @@ -346,16 +346,10 @@ impl Machine { result += "[]", CellView::Con(&Constant::Atom(ref atom)) => result += atom.as_str(), - CellView::HeapVar(cell_num) => { + CellView::HeapVar(cell_num) | CellView::StackVar(_, cell_num) => { result += "_"; result += cell_num.to_string().as_str(); }, - CellView::StackVar(fr, sc) => { - result += "_"; - result += fr.to_string().as_str(); - result += "_"; - result += sc.to_string().as_str(); - }, CellView::Str(_, ref name) => result += name.as_str(), CellView::TToken(TToken::Bar) => { -- 2.54.0