gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control systemdiff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
prl(createTopTwoEStack());
if (genInlinePrint){
prl(createComment("print spacing and transformation",C_SPEC));
- prl("PRINFLUSH(SUBSTR(\" \", 0, MIN(10, tempa - 1)), @List_To_String(< tempb >));");
+ prl("PRINFLUSH(SUBSTR(\" \", 0, MIN(10, MAX(0,tempa-1))), @List_To_String(< tempb >));");
} else
prl("Print_MJ_CHAR(tempb,tempa);");
prl(createEndVar());
prl(createTopTwoEStack());
if (genInlinePrint){
prl(createComment("print spacing",C_SPEC));
- prl("PRINFLUSH(SUBSTR(\" \", 0, MIN(10, tempa - 1)), tempb);");
+ prl("PRINFLUSH(SUBSTR(\" \", 0, MIN(10, MAX(0, tempa-1))), tempb);");
}
else
prl("Print_MJ(tempb,tempa);");
public void printHelpDirectives(){
System.out.println("Alternatives for code generation:");
System.out.println(" --genPopPush generate POP/PUSH instead of TAIL/HEAD");
+ System.out.println(" --genHeadTail generate TAIL/HEAD instead of POP/PUSH ");
+ System.out.println();
+ System.out.println(" --genInlinePrint generate prints directly instead of procedure calls");
+ System.out.println(" --genProcedurePrint generate prints as custom procedure calls");
}
public void printHelpHelp() {
genPopPush = true;
} else if (args[i].compareToIgnoreCase("--genInlinePrint") == 0) {
genInlinePrint = true;
+ } else if (args[i].compareToIgnoreCase("--genHeadTail") == 0) {
+ genPopPush = false;
+ } else if (args[i].compareToIgnoreCase("--genProcedurePrint") == 0) {
+ genInlinePrint = false;
}
i++;
}