From aa14c6705da4e972cf83240d232a0ae999868541 Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> Date: Sun, 27 Oct 2024 09:54:35 +0100 Subject: [PATCH] Change separators & fix float handling --- src/functions.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/functions.rs b/src/functions.rs index 6db5e6b..55b6678 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -344,11 +344,11 @@ impl PostScriptOp { fn write_slice(ops: &[Self], buf: &mut Vec) { buf.push(b'{'); if ops.len() > 1 { - buf.push(b'\n'); + buf.push(b' '); } for op in ops { op.write(buf); - buf.push(b'\n'); + buf.push(b' '); } if ops.len() == 1 { buf.pop(); @@ -358,18 +358,18 @@ impl PostScriptOp { fn write(&self, buf: &mut Vec) { match self { - Self::Real(r) => buf.push_decimal(*r), + Self::Real(r) => buf.push_float(*r), Self::Integer(i) => buf.push_val(*i), Self::If(ops) => { Self::write_slice(&ops, buf); - buf.push(b'\n'); + buf.push(b' '); buf.extend(self.operator()); } Self::IfElse(ops1, ops2) => { Self::write_slice(&ops1, buf); - buf.push(b'\n'); + buf.push(b' '); Self::write_slice(&ops2, buf); - buf.push(b'\n'); + buf.push(b' '); buf.extend(self.operator()); } _ => buf.extend(self.operator()),