ooc-lang / rock

:ocean: self-hosted ooc compiler that generates c99
http://ooc-lang.org/
MIT License
403 stars 40 forks source link

Allow range expressions to be iterated through by for statements. #953

Closed alexnask closed 8 years ago

alexnask commented 8 years ago

Closes #951
Also, sneakily fix the indexing in range for loops (the backend generated wrong code)

vendethiel commented 8 years ago

Cool stuff! :+1: (was there already a test for the fixed bug?)

alexnask commented 8 years ago

@vendethiel
See the last two commits (test/compiler/control/foreach-range-generated.ooc)
This is basically the most complex case (side-effects, index variable) :)