gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
ant - added build task for versioning by using 'git describe'
[mjc2wsl.git] / src / mjc2wsl.java
index d52dcfe..14cc9e4 100644 (file)
@@ -694,7 +694,7 @@ public class mjc2wsl{
                                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());
@@ -707,7 +707,7 @@ public class mjc2wsl{
                                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);");
@@ -787,6 +787,10 @@ public class mjc2wsl{
        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() {
@@ -861,6 +865,10 @@ public class mjc2wsl{
                                        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++;
                        }
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner