]> Repositorios git - scryer-prolog.git/commitdiff
code cleanup
authorMark Thom <[email protected]>
Wed, 10 May 2017 16:21:02 +0000 (10:21 -0600)
committerMark Thom <[email protected]>
Wed, 10 May 2017 16:21:02 +0000 (10:21 -0600)
src/prolog/codegen.rs
src/prolog/machine.rs

index 193e145ef7a8956deed7adba807c2b1902272cbb..00d07d4b7a7238d46206af1c0453f93c5095204d 100644 (file)
@@ -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);
                     }
index 63e68c8350e8e190cc7649aafd791eec80a353fb..6efb3e12d991510159b56ab557698cf50c9c5cc1 100644 (file)
@@ -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) => {