From: Doni Pracner Date: Wed, 11 Jun 2014 15:02:25 +0000 (+0200) Subject: array assignment simplified X-Git-Tag: v0.1.7~2 X-Git-Url: http://svarog.pmf.uns.ac.rs/gitweb/?p=mjc2wsl.git;a=commitdiff_plain;h=9ad77207956d30c4ad2e3020d389989777e5b7b4 array assignment simplified --- diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java index 5472d55..18551d1 100644 --- a/src/mjc2wsl.java +++ b/src/mjc2wsl.java @@ -570,12 +570,11 @@ public class mjc2wsl{ } case astore: case bastore: { + prl(createStartVar("tempa", "tempb", "tempres")); prl(createFromEStack("tempres")); prl(createTopTwoEStack()); - // we need to use a temparray as a pointer, WSL - // otherwise tries to access it as a list of lists and fails - prl("VAR < tempArray := " + createArray("tempb") + " > :"); - prl("tempArray[tempa+1]:=tempres ENDVAR;"); + prl("mjvm_arrays[tempb][tempa+1]:=tempres;"); + prl(createEndVar()); break; } case arraylength: {