From: Doni Pracner Date: Mon, 20 Jan 2014 17:05:40 +0000 (+0100) Subject: mjc2wsl - array length added, but only formally, there are problems with this X-Git-Tag: v0.1.4~15 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=febf6617024a975bf47d970941371a87ac6f59ad;p=mjc2wsl.git mjc2wsl - array length added, but only formally, there are problems with this --- diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java index 82ae9cc..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 : {