unify '[]' with proper [] in atom_chars/2 (#569)
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -905,9 +905,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "prolog_parser"
|
name = "prolog_parser"
|
||||||
version = "0.8.65"
|
version = "0.8.66"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fdcfe8260335a150812e36b171ff985ce88f02de16c05f4a13fe4f10e8c247f8"
|
checksum = "e35f5db0eb6725d00be12f3c9550de0dce0a43a1fa25a873f879613d63fcbbd5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lexical",
|
"lexical",
|
||||||
"num-rug-adapter",
|
"num-rug-adapter",
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ libc = "0.2.62"
|
|||||||
nix = "0.15.0"
|
nix = "0.15.0"
|
||||||
num-rug-adapter = { optional = true, version = "0.1.3" }
|
num-rug-adapter = { optional = true, version = "0.1.3" }
|
||||||
ordered-float = "0.5.0"
|
ordered-float = "0.5.0"
|
||||||
prolog_parser = { version = "0.8.65", default-features = false }
|
prolog_parser = { version = "0.8.66", default-features = false }
|
||||||
ref_thread_local = "0.0.0"
|
ref_thread_local = "0.0.0"
|
||||||
rug = { version = "1.4.0", optional = true }
|
rug = { version = "1.4.0", optional = true }
|
||||||
rustyline = "6.0.0"
|
rustyline = "6.0.0"
|
||||||
|
|||||||
@@ -1029,6 +1029,9 @@ impl MachineState {
|
|||||||
|
|
||||||
match iter.focus() {
|
match iter.focus() {
|
||||||
Addr::EmptyList => {
|
Addr::EmptyList => {
|
||||||
|
if &string == "[]" {
|
||||||
|
self.unify(addr, Addr::EmptyList);
|
||||||
|
} else {
|
||||||
let chars = clause_name!(string, indices.atom_tbl);
|
let chars = clause_name!(string, indices.atom_tbl);
|
||||||
let atom = self.heap.to_unifiable(
|
let atom = self.heap.to_unifiable(
|
||||||
HeapCellValue::Atom(chars, None)
|
HeapCellValue::Atom(chars, None)
|
||||||
@@ -1036,13 +1039,14 @@ impl MachineState {
|
|||||||
|
|
||||||
self.unify(addr, atom);
|
self.unify(addr, atom);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
focus => {
|
focus => {
|
||||||
|
if let Addr::Lis(l) = focus {
|
||||||
let stub = MachineError::functor_stub(
|
let stub = MachineError::functor_stub(
|
||||||
clause_name!("atom_chars"),
|
clause_name!("atom_chars"),
|
||||||
2,
|
2,
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Addr::Lis(l) = focus {
|
|
||||||
let err = MachineError::type_error(
|
let err = MachineError::type_error(
|
||||||
self.heap.h(),
|
self.heap.h(),
|
||||||
ValidType::Character,
|
ValidType::Character,
|
||||||
|
|||||||
Reference in New Issue
Block a user