gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2563c48)
raw | patch | inline | side by side (parent: 2563c48)
author | Doni Pracner <quinnuendo@gmail.com> | |
Thu, 12 Jun 2014 20:43:19 +0000 (22:43 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Thu, 12 Jun 2014 20:43:19 +0000 (22:43 +0200) |
src/mjc2wsl.java | patch | blob | history |
diff --git a/src/mjc2wsl.java b/src/mjc2wsl.java
--- a/src/mjc2wsl.java
+++ b/src/mjc2wsl.java
case getfield: {
int f = get2();
+ prl(createStartVar("tempa"));
prl(createTopEStack());
prl(createToEStack(createObject("tempa") + "[" + (f + 1) + "]"));
+ prl(createEndVar());
break;
}
case putfield: {
int f = get2();
- // we need to use a temparray as a pointer, WSL
- // otherwise tries to access it as a list of lists and fails
- prl(createTopTwoEStack());
- prl("VAR < tempArray := " + createObject("tempb") + " > :");
- prl("tempArray[" + (f + 1) + "]:=tempa ENDVAR;");
+ prl(createStartVar("tempa", "tempb"));
+ prl(createTopTwoEStack());
+ prl(createObject("tempb") + "[" + (f + 1) + "]:=tempa;");
+ prl(createEndVar());
break;
}