gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
mjc2wsl - prints and reads, using the same code blocks, support spacings, prints...
authorDoni Pracner <quinnuendo@gmail.com>
Wed, 8 Jan 2014 22:10:27 +0000 (23:10 +0100)
committerDoni Pracner <quinnuendo@gmail.com>
Wed, 8 Jan 2014 22:22:21 +0000 (23:22 +0100)
src/mjc2wsl.java

index d098bd8e2069d97e23df332a754c6e835aa487b8..05a8a32fab2ee297acf28a8f17d53d57c682886d 100644 (file)
@@ -434,23 +434,24 @@ public class mjc2wsl{
                                break;
                        }
 
-                       //TODO read, print
+                       // read, print
+                       case bread:
                        case read: {
+                               //TODO make it a char for read
                                prl("tempa := @String_To_Num(@Read_Line(Standard_Input_Port));");
                                prl(cmdToEStack("tempa"));
                                break;
                        }
 
                        // the prints
-                       case bprint: {
-                               prl(getTopTwo());
-                               prl("PRINT(tempb);");
-                               break;
-                       }
+                       case bprint: 
                        case print: {
-                               // TODO need to make it a char
+                               // TODO need to make it a char on print
+                               // TODO printing numbers needs different lengths of spacing
                                prl(getTopTwo());
-                               prl("PRINT(tempb);");
+                               pr(createComment("print spacing",C_SPEC));
+                               prl("IF tempa>1 THEN FOR i:=2 TO tempa STEP 1 DO PRINFLUSH(\" \") OD FI;");
+                               prl("PRINFLUSH(tempb);");
                                break;
                        }
 
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner