From: Mark Thom Date: Sun, 16 Sep 2018 20:21:50 +0000 (-0600) Subject: correct conformity error X-Git-Tag: v0.8.110~374 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=8eb327c7352ffc5a3fcf5889b17f51f5bad18e0f;p=scryer-prolog.git correct conformity error --- 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]