gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
mjc2wsl - inline printing - use the new @Format instead of substringing
[mjc2wsl.git] / src / com / quemaster / transformations / mjc2wsl / mjc2wsl.java
index 78f30eb..f5714aa 100644 (file)
@@ -213,7 +213,7 @@ public class mjc2wsl{
                                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:=1 TO ");
-                               ret.append("MAX(0, format-SLENGTH(@String(tempb))) STEP 1 DO PRINFLUSH(\" \") OD\n");
+                               ret.append("MAX(0, format-SLENGTH(@String(val))) STEP 1 DO PRINFLUSH(\" \") OD\n");
                                ret.append("\tFI;\n\tPRINFLUSH(val)\nEND\n");
 
                                ret.append("\nPROC Print_MJ_CHAR(val, format VAR)==\n");
@@ -676,7 +676,7 @@ public class mjc2wsl{
                                prl(createTopTwoEStack());
                                if (genInlinePrint){
                                        prl(createComment("print spacing and transformation",C_SPEC));
-                                       prl("PRINFLUSH(SUBSTR(\"          \", 0, MIN(10, MAX(0,tempa-1))), @List_To_String(< tempb >));");
+                                       prl("PRINFLUSH(@Format(tempa, @List_To_String(< tempb >)));");
                                } else
                                        prl("Print_MJ_CHAR(tempb,tempa);");
                                prl(createEndVar());
@@ -688,7 +688,7 @@ public class mjc2wsl{
                                prl(createTopTwoEStack());
                                if (genInlinePrint){
                                        prl(createComment("print spacing",C_SPEC));
-                                       prl("PRINFLUSH(SUBSTR(\"          \", 0, MIN(10, MAX(0, tempa-SLENGTH(@String(tempb))))), tempb);");
+                                       prl("PRINFLUSH(@Format(tempa,tempb));");
                                }
                                else
                                        prl("Print_MJ(tempb,tempa);");
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner