Skip to content

Commit

Permalink
Change separators & fix float handling
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Oct 27, 2024
1 parent 0349ea1 commit aa14c67
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,11 @@ impl PostScriptOp {
fn write_slice(ops: &[Self], buf: &mut Vec<u8>) {
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();
Expand All @@ -358,18 +358,18 @@ impl PostScriptOp {

fn write(&self, buf: &mut Vec<u8>) {
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()),
Expand Down

0 comments on commit aa14c67

Please sign in to comment.