Simplify loop building by encoding open/closed bound information in the

HeaderInfo object, and modifying the operator in the loop condition.

The "additional emptiness condition" is no longer necessary with this.
The open/closed property was removed from HeaderInfo in an earlier
commit, but bringing it back in to simplify the loop building makes
more sense.

Also expanded tests for evaluation order of range bounds.
This commit is contained in:
Mark Punzalan
2019-04-02 10:12:55 -07:00
committed by max-kammerer
parent 7680e7fd56
commit dd65e0876f
16 changed files with 454 additions and 361 deletions
@@ -1,6 +1,6 @@
fun test(): Int {
fun test(a: Int, b: Int): Int {
var sum = 0
for (i in 1 until 6) {
for (i in a until b) {
sum = sum * 10 + i
}
return sum