gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
mjc2wsl - support for array length is now functional in FermaT
authorDoni Pracner <quinnuendo@gmail.com>
Sat, 8 Feb 2014 12:03:34 +0000 (13:03 +0100)
committerDoni Pracner <quinnuendo@gmail.com>
Sat, 8 Feb 2014 12:03:34 +0000 (13:03 +0100)
src/mjc2wsl.java

index 67586be2ba144cea3a2b41bc4458aabde355e613..83a84de3c4f93be0ea9ef1a8fd859224acb964df 100644 (file)
@@ -501,13 +501,8 @@ public class mjc2wsl{
                        }
                        case arraylength: {
                                prl(createTopEStack());
-                               // TODO make an array length function of some sort!
-                               prl(createComment(
-                                               "array length not known - LENGTH not aplicable to arrays",
-                                               C_ERR));
-                               messages.message("array length not known - LENGTH not aplicable to arrays", TransMessages.M_ERR);
-                               prl(createComment("put 1 on the stack for consistency", C_SPEC));
-                               prl(createToEStack(1));
+                               prl("tempb := LENGTH("+ createArray("tempa") + ");");
+                               prl(createToEStack("tempb"));
                                break;
                        }
 
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner