From 8eb327c7352ffc5a3fcf5889b17f51f5bad18e0f Mon Sep 17 00:00:00 2001 From: Mark Thom Date: Sun, 16 Sep 2018 14:21:50 -0600 Subject: [PATCH] correct conformity error --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/prolog/heap_print.rs | 4 ++-- src/tests.rs | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a97c8e33..5053b63b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -108,7 +108,7 @@ dependencies = [ [[package]] name = "rusty-wam" -version = "0.7.12" +version = "0.7.13" dependencies = [ "downcast 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 35912969..8fb7c224 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rusty-wam" -version = "0.7.12" +version = "0.7.13" authors = ["Mark Thom "] repository = "https://github.com/mthom/rusty-wam" description = "The Warren Abstract Machine in Rust." diff --git a/src/prolog/heap_print.rs b/src/prolog/heap_print.rs index 4b111c45..94549c4b 100644 --- a/src/prolog/heap_print.rs +++ b/src/prolog/heap_print.rs @@ -433,12 +433,12 @@ impl<'a, Formatter: HCValueFormatter, Outputter: HCValueOutputter> }; match heap_val { - HeapCellValue::NamedStr(arity, name, Some(fixity)) => { + HeapCellValue::NamedStr(arity, ref name, Some(fixity)) if name.as_str() != "," => { if composite_brackets { self.state_stack.push(TokenOrRedirect::Close); } - let ct = ClauseType::from(name, arity, Some(fixity)); + let ct = ClauseType::from(name.clone(), arity, Some(fixity)); self.formatter.format_clause(iter, arity, ct, &mut self.state_stack); if composite_brackets { diff --git a/src/tests.rs b/src/tests.rs index b581bd70..c2a139ea 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1669,6 +1669,8 @@ fn test_queries_on_builtins() [["X = (-)-(-)"]]); assert_prolog_success!(&mut wam, "?- X = ((:-):-(:-)).", [["X = (:-):-(:-)"]]); + assert_prolog_success!(&mut wam, "?- X = (a:-b,c).", + [["X = a:-b,c"]]); } #[test] -- 2.54.0