gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5ec7c01)
raw | patch | inline | side by side (parent: 5ec7c01)
author | Doni Pracner <quinnuendo@gmail.com> | |
Fri, 25 Jul 2014 19:10:08 +0000 (21:10 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Fri, 25 Jul 2014 19:11:06 +0000 (21:11 +0200) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
index f754e4ef1d6c3cf719ca58c08bdb80fa06466ccf..d52dcfeea0f4a9274d739ef3b0caabe29b37fe1d 100644 (file)
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
private boolean genPopPush=false;
+ private boolean genInlinePrint=false;
+
/** Constant used for marking a regular comment from the original file */
public static final char C_REG = ' ';
/**
ret.append("\t@List_To_String(< num >)\n");
ret.append("END\n");
- 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("\tFI;\n\tPRINFLUSH(val)\nEND\n");
-
- ret.append("\nPROC Print_MJ_CHAR(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("\tFI;\n\tPRINFLUSH(CHR(val))\n");
- ret.append("END\n");
+ 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("\tFI;\n\tPRINFLUSH(val)\nEND\n");
+
+ ret.append("\nPROC Print_MJ_CHAR(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("\tFI;\n\tPRINFLUSH(CHR(val))\n");
+ ret.append("END\n");
+ }
ret.append("\nEND");
return ret.toString();
case bprint: {
prl(createStartVar("tempa", "tempb"));
prl(createTopTwoEStack());
- prl("Print_MJ_CHAR(tempb,tempa);");
+ if (genInlinePrint){
+ prl(createComment("print spacing and transformation",C_SPEC));
+ prl("PRINFLUSH(SUBSTR(\" \", 0, MIN(10, tempa - 1)), @List_To_String(< tempb >));");
+ } else
+ prl("Print_MJ_CHAR(tempb,tempa);");
prl(createEndVar());
break;
}
prl(createStartVar("tempa", "tempb"));
prl(createTopTwoEStack());
- prl("Print_MJ(tempb,tempa);");
+ if (genInlinePrint){
+ prl(createComment("print spacing",C_SPEC));
+ prl("PRINFLUSH(SUBSTR(\" \", 0, MIN(10, tempa - 1)), tempb);");
+ }
+ else
+ prl("Print_MJ(tempb,tempa);");
prl(createEndVar());
break;
}
genPauseAfterEachAddress = true;
} else if (args[i].compareToIgnoreCase("--genPopPush") == 0) {
genPopPush = true;
+ } else if (args[i].compareToIgnoreCase("--genInlinePrint") == 0) {
+ genInlinePrint = true;
}
i++;
}