X-Git-Url: http://svarog.pmf.uns.ac.rs/gitweb/?p=mjc2wsl.git;a=blobdiff_plain;f=src%2Fmjc2wsl.java;h=6f7efe17b770d362c6af3324582bb2336f4a44e5;hp=3a9727031b389fd4833b5ee2f8026e5be3a9f0ea;hb=febf6617024a975bf47d970941371a87ac6f59ad;hpb=a2b31532a5ab77cf13fc50ddc28c303949ad1207 diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java index 3a97270..6f7efe1 100644 --- a/src/mjc2wsl.java +++ b/src/mjc2wsl.java @@ -463,7 +463,16 @@ public class mjc2wsl{ prl("tempArray[tempa+1]:=tempres ENDVAR;"); break; } - //TODO arraylength + case arraylength :{ + prl(getTop()); + //TODO make an array length function of some sort! + prl(createComment("array length not known - LENGTH not aplicable to arrays",C_ERR)); + message("array length not known - LENGTH not aplicable to arrays",M_ERR); + prl(createComment("put 1 on the stack for consistency",C_SPEC)); + prl(cmdToEStack(1)); + break; + } + //TODO dup, dup2 case pop : { @@ -496,9 +505,9 @@ public class mjc2wsl{ } case return_: { - prl("IF EMPTY?(mjvm_mstack) THEN CALL Z FI"); - //else we let things return - prl("END b"+counter+" =="); + //we let the actions return + // there is nothing to clean up + prl("SKIP END b"+counter+" =="); break; } case enter: {