check ambiguity of "'" against tail if atom token is about to be quoted

This commit is contained in:
Mark
2023-06-29 17:59:25 -06:00
parent 8140ff9154
commit a09306c585

View File

@@ -568,7 +568,12 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> {
#[inline] #[inline]
fn ambiguity_check(&self, atom: &str) -> bool { fn ambiguity_check(&self, atom: &str) -> bool {
let tail = self.outputter.range_from(self.last_item_idx..); let tail = self.outputter.range_from(self.last_item_idx..);
if !self.quoted || non_quoted_token(atom.chars()) {
requires_space(tail, atom) requires_space(tail, atom)
} else {
requires_space(tail, "'")
}
} }
fn enqueue_op(&mut self, mut max_depth: usize, name: Atom, spec: OpDesc) { fn enqueue_op(&mut self, mut max_depth: usize, name: Atom, spec: OpDesc) {