From: Mark Date: Thu, 29 Jun 2023 23:59:25 +0000 (-0600) Subject: check ambiguity of "'" against tail if atom token is about to be quoted X-Git-Tag: v0.9.2~95^2~7 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=a09306c58524fb9f378d6df6cbe60a1b9922e08e;p=scryer-prolog.git check ambiguity of "'" against tail if atom token is about to be quoted --- diff --git a/src/heap_print.rs b/src/heap_print.rs index 3f48aed7..4025339c 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -568,7 +568,12 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { #[inline] fn ambiguity_check(&self, atom: &str) -> bool { let tail = self.outputter.range_from(self.last_item_idx..); - requires_space(tail, atom) + + if !self.quoted || non_quoted_token(atom.chars()) { + requires_space(tail, atom) + } else { + requires_space(tail, "'") + } } fn enqueue_op(&mut self, mut max_depth: usize, name: Atom, spec: OpDesc) {