]> Repositorios git - scryer-prolog.git/commitdiff
fix broken quoting in writeq/1 (#1498)
authorMark Thom <[email protected]>
Wed, 1 Jun 2022 00:12:19 +0000 (18:12 -0600)
committerMark Thom <[email protected]>
Wed, 1 Jun 2022 00:29:42 +0000 (18:29 -0600)
src/heap_print.rs

index 8316cd13f86e881142df3d68d766ca35fe222cc5..9a8d154c1e31122c77ab6b2ec9bc3e1e08d9bf30 100644 (file)
@@ -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),
             }
         };