don't return ops with priority 0 when building set for current_op (#1571)
This commit is contained in:
@@ -1122,7 +1122,6 @@ current_predicate(Pred) :-
|
|||||||
can_be_op_priority(Priority) :- var(Priority).
|
can_be_op_priority(Priority) :- var(Priority).
|
||||||
can_be_op_priority(Priority) :- op_priority(Priority).
|
can_be_op_priority(Priority) :- op_priority(Priority).
|
||||||
|
|
||||||
|
|
||||||
can_be_op_specifier(Spec) :- var(Spec).
|
can_be_op_specifier(Spec) :- var(Spec).
|
||||||
can_be_op_specifier(Spec) :- op_specifier(Spec).
|
can_be_op_specifier(Spec) :- op_specifier(Spec).
|
||||||
|
|
||||||
|
|||||||
@@ -757,7 +757,6 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
|||||||
.map(|code_idx| code_idx.set(old_code_idx));
|
.map(|code_idx| code_idx.set(old_code_idx));
|
||||||
}
|
}
|
||||||
RetractionRecord::AddedIndex(index_key, clause_loc) => {
|
RetractionRecord::AddedIndex(index_key, clause_loc) => {
|
||||||
// WAS: inner_index_locs) => {
|
|
||||||
if let Some(index_loc) = index_key.switch_on_term_loc() {
|
if let Some(index_loc) = index_key.switch_on_term_loc() {
|
||||||
let indexing_code = match &mut self.wam_prelude.code[index_loc] {
|
let indexing_code = match &mut self.wam_prelude.code[index_loc] {
|
||||||
Instruction::IndexingCode(indexing_code) => indexing_code,
|
Instruction::IndexingCode(indexing_code) => indexing_code,
|
||||||
|
|||||||
@@ -3583,6 +3583,12 @@ impl Machine {
|
|||||||
let (op_prec, op_spec) =
|
let (op_prec, op_spec) =
|
||||||
(op_desc.get_prec(), op_desc.get_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 {
|
let op_spec = match op_spec as u32 {
|
||||||
XFX => atom!("xfx"),
|
XFX => atom!("xfx"),
|
||||||
XFY => atom!("xfy"),
|
XFY => atom!("xfy"),
|
||||||
@@ -3609,6 +3615,12 @@ impl Machine {
|
|||||||
for op_desc in op_descs {
|
for op_desc in op_descs {
|
||||||
if let Some((key, op_desc)) = op_desc {
|
if let Some((key, op_desc)) = op_desc {
|
||||||
let (prec, spec) = (op_desc.get_prec(), op_desc.get_spec());
|
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));
|
unossified_op_dir.insert(*key, (prec as usize, spec as Specifier));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3625,6 +3637,7 @@ impl Machine {
|
|||||||
let name = key.0;
|
let name = key.0;
|
||||||
|
|
||||||
if other_prec == 0 {
|
if other_prec == 0 {
|
||||||
|
// 8.14.4, note 2
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user