do a better job recognizing and bracketing operators
This commit is contained in:
@@ -14,7 +14,7 @@ cfg-if = "0.1.7"
|
|||||||
downcast = "0.10.0"
|
downcast = "0.10.0"
|
||||||
num = "0.2"
|
num = "0.2"
|
||||||
ordered-float = "0.5.0"
|
ordered-float = "0.5.0"
|
||||||
prolog_parser = "0.8.8"
|
prolog_parser = { version = "0.8.9", path = "../prolog_parser" }
|
||||||
readline_rs_compat = { version = "0.1.7", optional = true }
|
readline_rs_compat = { version = "0.1.7", optional = true }
|
||||||
ref_thread_local = "0.0.0"
|
ref_thread_local = "0.0.0"
|
||||||
|
|
||||||
|
|||||||
@@ -536,7 +536,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter>
|
|||||||
fn print_atom(&mut self, atom: &ClauseName) {
|
fn print_atom(&mut self, atom: &ClauseName) {
|
||||||
push_space_if_amb!(self, atom.as_str(), {
|
push_space_if_amb!(self, atom.as_str(), {
|
||||||
match atom.as_str() {
|
match atom.as_str() {
|
||||||
"" => self.append_str("''"),
|
"''" => self.append_str("''"),
|
||||||
s => self.print_op_addendum(s)
|
s => self.print_op_addendum(s)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1880,8 +1880,10 @@ impl MachineState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_functor_compound_case(&mut self, name: ClauseName, arity: usize) {
|
fn try_functor_compound_case(&mut self, name: ClauseName, arity: usize,
|
||||||
let name = Addr::Con(Constant::Atom(name, None));
|
spec: Option<(usize, Specifier)>)
|
||||||
|
{
|
||||||
|
let name = Addr::Con(Constant::Atom(name, spec));
|
||||||
let arity = Addr::Con(integer!(arity));
|
let arity = Addr::Con(integer!(arity));
|
||||||
|
|
||||||
self.try_functor_unify_components(name, arity);
|
self.try_functor_unify_components(name, arity);
|
||||||
@@ -1898,12 +1900,12 @@ impl MachineState {
|
|||||||
self.try_functor_unify_components(a1, Addr::Con(integer!(0))),
|
self.try_functor_unify_components(a1, Addr::Con(integer!(0))),
|
||||||
Addr::Str(o) =>
|
Addr::Str(o) =>
|
||||||
match self.heap[o].clone() {
|
match self.heap[o].clone() {
|
||||||
HeapCellValue::NamedStr(arity, name, _) =>
|
HeapCellValue::NamedStr(arity, name, spec) =>
|
||||||
self.try_functor_compound_case(name, arity),
|
self.try_functor_compound_case(name, arity, spec),
|
||||||
_ => self.fail = true
|
_ => self.fail = true
|
||||||
},
|
},
|
||||||
Addr::Lis(_) =>
|
Addr::Lis(_) =>
|
||||||
self.try_functor_compound_case(clause_name!("."), 2),
|
self.try_functor_compound_case(clause_name!("."), 2, None),
|
||||||
Addr::AttrVar(..) | Addr::HeapCell(_) | Addr::StackCell(..) => {
|
Addr::AttrVar(..) | Addr::HeapCell(_) | Addr::StackCell(..) => {
|
||||||
let name = self.store(self.deref(self[temp_v!(2)].clone()));
|
let name = self.store(self.deref(self[temp_v!(2)].clone()));
|
||||||
let arity = self.store(self.deref(self[temp_v!(3)].clone()));
|
let arity = self.store(self.deref(self[temp_v!(3)].clone()));
|
||||||
|
|||||||
Reference in New Issue
Block a user