don't return ops with priority 0 when building set for current_op (#1571)

This commit is contained in:
Mark Thom
2022-08-19 23:41:47 -06:00
parent 069e132c0e
commit d4c0277065
3 changed files with 13 additions and 2 deletions

View 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).

View 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,

View 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;
}