For loop on arrays working, untested, read more

Needed: break and continue support, extensive tests, other iterables
This commit is contained in:
2026-05-24 18:13:18 +10:00
parent 813da3e1aa
commit f11bc95833
10 changed files with 241 additions and 58 deletions
+23
View File
@@ -0,0 +1,23 @@
```toy
for (var name in array) {
//
}
```
pushStack name
pushStack array
pushStack counter //tracks the index for each loop
OPCODE iterable:
pushScope
declare name = array.next() if next is not null else jump to end
(user code)
popScope
jump to beginning
popStack counter, array, name