]> Repositorios git - scryer-prolog.git/commitdiff
implement less defaulty interface in cont.pl
authorMark Thom <[email protected]>
Mon, 23 Dec 2019 19:19:18 +0000 (12:19 -0700)
committerMark Thom <[email protected]>
Mon, 23 Dec 2019 19:19:18 +0000 (12:19 -0700)
Cargo.lock
src/prolog/lib/cont.pl
src/prolog/machine/system_calls.rs

index 19d316e981f21610f297e9c39363a98a0235de13..ea650ad5f53f5b9a13082878f0efae0a2f493786 100644 (file)
@@ -312,6 +312,7 @@ dependencies = [
 [[package]]
 name = "prolog_parser"
 version = "0.8.37"
+source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "lexical 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-rug-adapter 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -446,7 +447,7 @@ dependencies = [
  "nix 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-rug-adapter 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "prolog_parser 0.8.37",
+ "prolog_parser 0.8.37 (registry+https://github.com/rust-lang/crates.io-index)",
  "ref_thread_local 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rug 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustyline 5.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -589,6 +590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 "checksum num-traits 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "443c53b3c3531dfcbfa499d8893944db78474ad7a1d87fa2d94d1a2231693ac6"
 "checksum ordered-float 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7eb5259643245d3f292c7a146b2df53bba24d7eab159410e648eb73dc164669d"
 "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
+"checksum prolog_parser 0.8.37 (registry+https://github.com/rust-lang/crates.io-index)" = "cb3da90085db170f1045f7d6851da12400ab205af9ec2acaa5ee42ab45a25dd8"
 "checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
 "checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
 "checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
index 630519a7f646277c0a798ad1dd1c1088af78300f..18d97005e2222758caf99ed6d251d7c7c7a78ee7 100644 (file)
@@ -1,16 +1,19 @@
 
 :- module(cont, [reset/3, shift/1]).
 
-reset(Goal, Cont, Term) :-
+reset(Goal, Ball, Cont) :-
     call(Goal),
     '$reset_cont_marker',
     '$bind_from_register'(Cont, 3),
-    '$bind_from_register'(Term, 4).
+    '$bind_from_register'(Ball, 4).
 
 shift(Term) :-
     '$nextEP'(first, E, P),
     get_chunks(E, P, L),
-    Cont = cont(call_continuation(L)),
+    (  L == [] ->
+       Cont = none
+    ;  Cont = cont(call_continuation(L))
+    ),
     '$write_cont_and_term'(_, _, Cont, Term),
     '$unwind_environments'.
 
index 3d575b93707d13538a6bab62e3ef9be2e03dc546..13138be8b8cd1574b59e9fdc215110d57737a1d5 100644 (file)
@@ -2197,8 +2197,12 @@ impl MachineState {
                 self.reset_block(addr);
             }
             &SystemClauseType::ResetContinuationMarker => {
-                self[temp_v!(3)] = Addr::Con(Constant::Integer(Integer::from(0)));
-                self[temp_v!(4)] = Addr::Con(Constant::Integer(Integer::from(0)));
+                self[temp_v!(3)] = Addr::Con(Constant::Atom(clause_name!("none"), None));
+
+                let h = self.heap.h;
+                self.heap.push(HeapCellValue::Addr(Addr::HeapCell(h)));
+
+                self[temp_v!(4)] = Addr::HeapCell(h);
             }
             &SystemClauseType::SetBall =>
                 self.set_ball(),