feat: implement for-in loop syntax with iterate/iteratorValue protocol and break support
Add `for (variable in sequence)` syntax to the Wren language, introducing the `in` keyword token and compiler support for iterating over sequences using `iterate` and `iteratorValue` methods. Includes new benchmark files for Lua, Python, Ruby, and Wren, plus test cases covering single-expression bodies, block bodies, closures over loop variables, and break statements. Also fixes a missing POP() in CLOSE_UPVALUE and moves the while test file to a subdirectory.
This commit is contained in:
@@ -26,8 +26,8 @@ Some people like to see all of the reserved words in a programming language in
|
||||
one lump. If you're one of those folks, here you go:
|
||||
|
||||
:::wren
|
||||
class else false fn for if is null
|
||||
return static this true var while
|
||||
break class else false fn for if in is
|
||||
null return static this true var while
|
||||
|
||||
## Statement terminators
|
||||
|
||||
|
||||
Reference in New Issue
Block a user