From: Doni Pracner Date: Sun, 27 Jul 2014 23:59:01 +0000 (+0200) Subject: mjc2wsl - fixed number print procedure to use the length of the number; removed TODO X-Git-Tag: v0.2.0~17 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=8a984fa798bb95ae5e1feb4907ce7c2a22b1e0ac;p=mjc2wsl.git mjc2wsl - fixed number print procedure to use the length of the number; removed TODO --- diff --git a/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java b/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java index 26452e8..9a61bbf 100644 --- a/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java +++ b/src/com/quemaster/transformations/mjc2wsl/mjc2wsl.java @@ -212,8 +212,8 @@ public class mjc2wsl{ if (!genInlinePrint) { ret.append("\nPROC Print_MJ(val, format VAR)==\n"); ret.append(createComment("print spacing", C_SPEC)); - ret.append("\n\tIF format>1 THEN\n\t\tFOR i:=2 TO "); - ret.append("format STEP 1 DO PRINFLUSH(\" \") OD\n"); + ret.append("\n\tIF format>1 THEN\n\t\tFOR i:=1 TO "); + ret.append("MAX(0, format-SLENGTH(@String(tempb))) STEP 1 DO PRINFLUSH(\" \") OD\n"); ret.append("\tFI;\n\tPRINFLUSH(val)\nEND\n"); ret.append("\nPROC Print_MJ_CHAR(val, format VAR)==\n"); @@ -670,7 +670,6 @@ public class mjc2wsl{ break; } case print: { - // TODO printing numbers needs different lengths of spacing prl(createStartVar("tempa", "tempb")); prl(createTopTwoEStack());