]> Repositorios git - scryer-prolog.git/commitdiff
don't return ops with priority 0 when building set for current_op (#1571)
authorMark Thom <[email protected]>
Sat, 20 Aug 2022 05:41:47 +0000 (23:41 -0600)
committerMark Thom <[email protected]>
Thu, 27 Oct 2022 05:36:07 +0000 (23:36 -0600)
src/lib/builtins.pl
src/machine/loader.rs
src/machine/system_calls.rs

index 536f0d67d37635610ae95f99d90618307bba2269..a0df16bfbb8eb83459800c2219d0eb1f6656e1d9 100644 (file)
@@ -1122,7 +1122,6 @@ current_predicate(Pred) :-
 can_be_op_priority(Priority) :- var(Priority).
 can_be_op_priority(Priority) :- op_priority(Priority).
 
-
 can_be_op_specifier(Spec) :- var(Spec).
 can_be_op_specifier(Spec) :- op_specifier(Spec).
 
index 7c9b380ce1fc00b4c07c8616ca8d6748946d136f..3495e5b328bf9c0830db1856b9fbbb9c77506780 100644 (file)
@@ -757,7 +757,6 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
                         .map(|code_idx| code_idx.set(old_code_idx));
                 }
                 RetractionRecord::AddedIndex(index_key, clause_loc) => {
-                    // WAS: inner_index_locs) => {
                     if let Some(index_loc) = index_key.switch_on_term_loc() {
                         let indexing_code = match &mut self.wam_prelude.code[index_loc] {
                             Instruction::IndexingCode(indexing_code) => indexing_code,
index 46506621c68e4d9583570837b9939bd5f79b8b8d..5ce4ff899e366130d21e4a2ca966b8b836ea8f4e 100644 (file)
@@ -3583,6 +3583,12 @@ impl Machine {
                                 let (op_prec, op_spec) =
                                     (op_desc.get_prec(), op_desc.get_spec());
 
+                                if op_prec == 0 {
+                                    // 8.14.4, note 2
+                                    self.machine_st.fail = true;
+                                    return;
+                                }
+
                                 let op_spec = match op_spec as u32 {
                                     XFX => atom!("xfx"),
                                     XFY => atom!("xfy"),
@@ -3609,6 +3615,12 @@ impl Machine {
                         for op_desc in op_descs {
                             if let Some((key, op_desc)) = op_desc {
                                 let (prec, spec) = (op_desc.get_prec(), op_desc.get_spec());
+
+                                if prec == 0 {
+                                    // 8.14.4, note 2
+                                    continue;
+                                }
+
                                 unossified_op_dir.insert(*key, (prec as usize, spec as Specifier));
                             }
                         }
@@ -3625,6 +3637,7 @@ impl Machine {
                         let name = key.0;
 
                         if other_prec == 0 {
+                            // 8.14.4, note 2
                             return None;
                         }