From: Mark Thom Date: Wed, 1 Jun 2022 00:12:19 +0000 (-0600) Subject: fix broken quoting in writeq/1 (#1498) X-Git-Tag: v0.9.1~16 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=5e1faeb5d2c8fa8e97434e89096b3316ac2bbda1;p=scryer-prolog.git fix broken quoting in writeq/1 (#1498) --- diff --git a/src/heap_print.rs b/src/heap_print.rs index 8316cd13..9a8d154c 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -1102,11 +1102,12 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { let iter = HeapPStrIter::new(self.iter.heap, focus); let char_to_string = |c: char| { - // refrain from quoting characters other than '"' and '\'. + // refrain from quoting characters other than '"' and '\' + // unless self.quoted is true. match c { '\\' => "\\\\".to_string(), '"' => "\\\"".to_string(), - _ => char_to_string(false, c) + _ => char_to_string(self.quoted, c), } };